From d2bf2b6178af6634bf2c8432b34369cdfa553612 Mon Sep 17 00:00:00 2001 From: jmoenig Date: Tue, 27 Oct 2020 16:46:59 +0100 Subject: [PATCH] prevent unclosable Morphic menus, thanks @brollb ! --- HISTORY.md | 3 ++- snap.html | 2 +- src/morphic.js | 7 ++++--- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/HISTORY.md b/HISTORY.md index 3a7f9098..0ad313a5 100755 --- a/HISTORY.md +++ b/HISTORY.md @@ -20,7 +20,8 @@ * German ### 2020-10-27 -* gui, objects, store: pause generic WHEN hat blocks when loading a project or importing a sprite until the user clicks the green flag or un-pauses the red stop sign, unless opening it with #run:&noRun +* gui, objects, store: pause generic WHEN hat blocks when loading a project or importing a sprite until the user clicks the green flag or un-pauses the red stop sign, unless opening it with #run:&noRun +* morphic: prevent unclosable menus, thanks, Brian B.! ### 2020-10-26 * objects: added test for the existence of generic WHEN hat blocks diff --git a/snap.html b/snap.html index 90684ff4..bbe5cfae 100755 --- a/snap.html +++ b/snap.html @@ -5,7 +5,7 @@ Snap! 6.3.0 - dev - Build Your Own Blocks - + diff --git a/src/morphic.js b/src/morphic.js index f547ed10..d1a38825 100644 --- a/src/morphic.js +++ b/src/morphic.js @@ -1271,7 +1271,7 @@ Michael Ball found and fixed a longstanding scrolling bug. Brian Harvey contributed to the design and implementation of submenus. Ken Kahn contributed to Chinese keboard entry and Android support. - Brian Broll contributed clickable URLs in text elements. + Brian Broll contributed clickable URLs in text elements and many bugfixes. - Jens Mönig */ @@ -1280,7 +1280,7 @@ /*global window, HTMLCanvasElement, FileReader, Audio, FileList, Map*/ -var morphicVersion = '2020-October-22'; +var morphicVersion = '2020-October-27'; var modules = {}; // keep track of additional loaded modules var useBlurredShadows = true; @@ -8400,7 +8400,8 @@ MenuMorph.prototype.destroy = function () { if (this.hasFocus) { this.world.keyboardFocus = null; } - if (!this.isListContents) { + const isActiveMenu = this.world.activeMenu === this; + if (!this.isListContents && isActiveMenu) { this.world.activeMenu = null; } MenuMorph.uber.destroy.call(this);