record unsaved changes when toggling a Boolean input slot

pull/95/head
jmoenig 2020-12-22 16:18:45 +01:00
rodzic 36742405f4
commit 15a47ace9a
1 zmienionych plików z 9 dodań i 3 usunięć

Wyświetl plik

@ -10528,15 +10528,21 @@ BooleanSlotMorph.prototype.setContents = function (boolOrNull) {
BooleanSlotMorph.prototype.toggleValue = function () { BooleanSlotMorph.prototype.toggleValue = function () {
var target = this.selectForEdit(), var target = this.selectForEdit(),
block = this.parentThatIsA(BlockMorph),
ide; ide;
if (target !== this) { if (target !== this) {
return this.toggleValue.call(target); return this.toggleValue.call(target);
} }
ide = this.parentThatIsA(IDE_Morph); ide = this.parentThatIsA(IDE_Morph);
this.value = this.nextValue(); this.value = this.nextValue();
if (ide && !ide.isAnimating) { if (ide) {
this.rerender(); if (!block.isTemplate) {
return; ide.recordUnsavedChanges();
}
if (!ide.isAnimating) {
this.rerender();
return;
}
} }
this.progress = 3; this.progress = 3;
this.rerender(); this.rerender();