summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjmoenig <jens@moenig.org>2014-07-11 17:59:16 +0200
committerjmoenig <jens@moenig.org>2014-07-11 17:59:16 +0200
commitc4968843e4129eb1b7355a20e6a5e72e67dea704 (patch)
tree8c0b0d38242a561f07777793defe7d646baf55bc
parent98772028bb648317a8825090540f81f71ad0003e (diff)
downloadsnap-c4968843e4129eb1b7355a20e6a5e72e67dea704.tar.gz
snap-c4968843e4129eb1b7355a20e6a5e72e67dea704.zip
fixed #508 (don’t popup empty menus)
thanks, @cycomached!
-rw-r--r--gui.js2
-rw-r--r--morphic.js3
-rw-r--r--objects.js6
3 files changed, 7 insertions, 4 deletions
diff --git a/gui.js b/gui.js
index 9b5f577..9f23ae2 100644
--- a/gui.js
+++ b/gui.js
@@ -1857,7 +1857,7 @@ IDE_Morph.prototype.removeSprite = function (sprite) {
IDE_Morph.prototype.userMenu = function () {
var menu = new MenuMorph(this);
- menu.addItem('help', 'nop');
+ // menu.addItem('help', 'nop');
return menu;
};
diff --git a/morphic.js b/morphic.js
index 6d93439..39b8741 100644
--- a/morphic.js
+++ b/morphic.js
@@ -6893,6 +6893,9 @@ MenuMorph.prototype.popup = function (world, pos) {
if (world.activeMenu) {
world.activeMenu.destroy();
}
+ if (this.items.length < 1 && !this.title) { // don't show empty menus
+ return;
+ }
world.add(this);
world.activeMenu = this;
this.fullChanged();
diff --git a/objects.js b/objects.js
index 1a9bb63..3cd3ca5 100644
--- a/objects.js
+++ b/objects.js
@@ -125,7 +125,7 @@ PrototypeHatBlockMorph*/
// Global stuff ////////////////////////////////////////////////////////
-modules.objects = '2014-July-08';
+modules.objects = '2014-July-11';
var SpriteMorph;
var StageMorph;
@@ -2577,7 +2577,7 @@ SpriteMorph.prototype.userMenu = function () {
menu = new MenuMorph(this);
if (ide && ide.isAppMode) {
- menu.addItem('help', 'nop');
+ // menu.addItem('help', 'nop');
return menu;
}
menu.addItem("duplicate", 'duplicate');
@@ -5116,7 +5116,7 @@ StageMorph.prototype.userMenu = function () {
myself = this;
if (ide && ide.isAppMode) {
- menu.addItem('help', 'nop');
+ // menu.addItem('help', 'nop');
return menu;
}
menu.addItem("edit", 'edit');