From 3fb5e880cc9baecd7a4bbf71222622bf057ffa09 Mon Sep 17 00:00:00 2001 From: jmoenig Date: Wed, 23 Oct 2019 08:40:39 +0200 Subject: [PATCH] fixed #2510 (disabled direct editing of list watchers for non-literal typed lists) such as costumes, avoids unloadable projects --- HISTORY.md | 4 ++++ snap.html | 2 +- src/lists.js | 9 +++++++-- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/HISTORY.md b/HISTORY.md index 13a481ac..c26529d4 100755 --- a/HISTORY.md +++ b/HISTORY.md @@ -14,11 +14,15 @@ * loading a project that fires STOP ALL from a WHEN hat block no longer "hangs" Snap * fixed pixel-manipulation distortions on newly imported hi-res images * assert that dimensions given for STRETCH are finite numbers (avoid crash) + * disabled direct editing of list watchers for non-literal typed lists (such as costumes, avoids unloadable projects) * fixed occasional "dead clicks" on buttons and menu items * **Translation Updates:** * English * German +### 2019-10-23 +* lists: disabled direct editing of list watchers for non-literal typed lists (such as costumes) + ### 2019-10-22 * morphic: url-clicking fix by @brollb, updated morphic documentation * pushed dev version to release-candidate status diff --git a/snap.html b/snap.html index 9ca118da..a87dfeac 100755 --- a/snap.html +++ b/snap.html @@ -11,7 +11,7 @@ - + diff --git a/src/lists.js b/src/lists.js index e2ffb99f..a7b67243 100644 --- a/src/lists.js +++ b/src/lists.js @@ -60,9 +60,9 @@ Color, Point, WatcherMorph, StringMorph, SpriteMorph, ScrollFrameMorph, CellMorph, ArrowMorph, MenuMorph, snapEquals, Morph, isNil, localize, isString, MorphicPreferences, TableDialogMorph, SpriteBubbleMorph, SpeechBubbleMorph, -TableFrameMorph, TableMorph, Variable, isSnapObject, Costume*/ +TableFrameMorph, TableMorph, Variable, isSnapObject, Costume, contains*/ -modules.lists = '2019-July-01'; +modules.lists = '2019-October-23'; var List; var ListWatcherMorph; @@ -657,6 +657,11 @@ ListWatcherMorph.prototype.init = function (list, parentCell) { this.plusButton.drawNew(); this.plusButton.fixLayout(); + // disable direct editing for non-literal typed lists (such as costumes): + if (this.list.type && !contains(['text', 'number'], this.list.type)) { + this.plusButton.hide(); + } + ListWatcherMorph.uber.init.call( this, SyntaxElementMorph.prototype.rounding,