migrated a bunch of calls to silentReplaceInput() in byob.js

pull/95/head
jmoenig 2020-04-07 08:15:12 +02:00
rodzic 54dc7008f0
commit 00b56d60c8
1 zmienionych plików z 6 dodań i 6 usunięć

Wyświetl plik

@ -108,7 +108,7 @@ BooleanSlotMorph, XML_Serializer, SnapTranslator*/
// Global stuff //////////////////////////////////////////////////////// // Global stuff ////////////////////////////////////////////////////////
modules.byob = '2020-April-05'; modules.byob = '2020-April-07';
// Declarations // Declarations
@ -609,7 +609,7 @@ CustomCommandBlockMorph.prototype.initializeVariables = function (oldVars) {
}); });
}; };
CustomCommandBlockMorph.prototype.refresh = function (aDefinition, silently) { CustomCommandBlockMorph.prototype.refresh = function (aDefinition, silently) { // +++ check silently
var def = aDefinition || this.definition, var def = aDefinition || this.definition,
newSpec = this.isPrototype ? newSpec = this.isPrototype ?
def.spec : def.localizedSpec(), def.spec : def.localizedSpec(),
@ -633,7 +633,7 @@ CustomCommandBlockMorph.prototype.refresh = function (aDefinition, silently) {
} else { } else {
this.fixBlockColor(); this.fixBlockColor();
} }
this.setSpec(newSpec, silently, def); this.setSpec(newSpec, silently, def); // +++ check silently
this.fixLabelColor(); this.fixLabelColor();
this.restoreInputs(oldInputs); this.restoreInputs(oldInputs);
} else { // update all input slots' drop-downs } else { // update all input slots' drop-downs
@ -675,7 +675,7 @@ CustomCommandBlockMorph.prototype.restoreInputs = function (oldInputs) {
old = oldInputs[i]; old = oldInputs[i];
if (old instanceof ReporterBlockMorph && if (old instanceof ReporterBlockMorph &&
(!(inp instanceof TemplateSlotMorph))) { (!(inp instanceof TemplateSlotMorph))) {
myself.silentReplaceInput(inp, old.fullCopy()); myself.replaceInput(inp, old.fullCopy());
} else if (old instanceof InputSlotMorph } else if (old instanceof InputSlotMorph
&& inp instanceof InputSlotMorph) { && inp instanceof InputSlotMorph) {
if (old.isEmptySlot()) { if (old.isEmptySlot()) {
@ -760,14 +760,14 @@ CustomCommandBlockMorph.prototype.refreshPrototype = function () {
hat.type === 'predicate', hat.type === 'predicate',
true true
); );
hat.silentReplaceInput(this, myself); hat.replaceInput(this, myself);
} else if (this instanceof CustomReporterBlockMorph) { } else if (this instanceof CustomReporterBlockMorph) {
if (hat.type === 'command') { if (hat.type === 'command') {
myself = new CustomCommandBlockMorph( myself = new CustomCommandBlockMorph(
this.definition, this.definition,
true true
); );
hat.silentReplaceInput(this, myself); hat.replaceInput(this, myself);
} else { } else {
this.isPredicate = (hat.type === 'predicate'); this.isPredicate = (hat.type === 'predicate');
this.fixLayout(); this.fixLayout();