From 15a47ace9aa6f2f9290f0ffd4d7f3146204e87cb Mon Sep 17 00:00:00 2001 From: jmoenig Date: Tue, 22 Dec 2020 16:18:45 +0100 Subject: [PATCH] record unsaved changes when toggling a Boolean input slot --- src/blocks.js | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/blocks.js b/src/blocks.js index a7048a8a..96f9768d 100644 --- a/src/blocks.js +++ b/src/blocks.js @@ -10528,15 +10528,21 @@ BooleanSlotMorph.prototype.setContents = function (boolOrNull) { BooleanSlotMorph.prototype.toggleValue = function () { var target = this.selectForEdit(), + block = this.parentThatIsA(BlockMorph), ide; if (target !== this) { return this.toggleValue.call(target); } ide = this.parentThatIsA(IDE_Morph); this.value = this.nextValue(); - if (ide && !ide.isAnimating) { - this.rerender(); - return; + if (ide) { + if (!block.isTemplate) { + ide.recordUnsavedChanges(); + } + if (!ide.isAnimating) { + this.rerender(); + return; + } } this.progress = 3; this.rerender();