refactored variable refactoring code

pull/29/head
jmoenig 2017-01-05 10:32:58 +01:00
rodzic bb8154a211
commit 0f006d3965
2 zmienionych plików z 128 dodań i 126 usunięć

Wyświetl plik

@ -150,7 +150,7 @@ CustomCommandBlockMorph*/
// Global stuff ////////////////////////////////////////////////////////
modules.blocks = '2017-January-04';
modules.blocks = '2017-January-05';
var SyntaxElementMorph;
var BlockMorph;
@ -3104,9 +3104,15 @@ BlockMorph.prototype.refactorThisVar = function (justTheTemplate) {
oldValue, newWatcher;
cpy.addShadow();
new DialogBoxMorph(
this,
function (newName) {
new DialogBoxMorph(this, renameVarTo, this).prompt(
'Variable name',
oldName,
this.world(),
cpy.fullImage(), // pic
InputSlotMorph.prototype.getVarNamesDict.call(this)
);
function renameVarTo (newName) {
var definer;
if (this.parent instanceof SyntaxElementMorph) {
@ -3223,15 +3229,7 @@ BlockMorph.prototype.refactorThisVar = function (justTheTemplate) {
ide.flushBlocksCache('variables');
ide.refreshPalette();
},
this
).prompt(
'Variable name',
oldName,
this.world(),
cpy.fullImage(), // pic
InputSlotMorph.prototype.getVarNamesDict.call(this)
);
}
function varExistsError (where) {
ide.inform(

Wyświetl plik

@ -3247,6 +3247,10 @@ http://snap.berkeley.edu/run#cloud:Username=jens&ProjectName=rotation
* Variable refactoring, yay! Thanks, Bernat!!
* Threads: fixed #1602
170105
------
* Blocks: refactored variable refactoring code
== v4.10 === (in development)