kopia lustrzana https://github.com/backface/turtlestitch
fix so you can't click item that opens submenu
rodzic
ac9fad3af2
commit
51aa5db3b0
27
morphic.js
27
morphic.js
|
@ -9479,8 +9479,10 @@ MenuItemMorph.prototype.mouseDownLeft = function (pos) {
|
||||||
if (this.isListItem()) {
|
if (this.isListItem()) {
|
||||||
this.parent.unselectAllItems();
|
this.parent.unselectAllItems();
|
||||||
this.escalateEvent('mouseDownLeft', pos);
|
this.escalateEvent('mouseDownLeft', pos);
|
||||||
}
|
this.image = this.pressImage;
|
||||||
this.image = this.pressImage;
|
} else if (!(this.doubleClickAction instanceof MenuMorph)) {
|
||||||
|
this.image = this.pressImage;
|
||||||
|
}
|
||||||
this.changed();
|
this.changed();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -9491,17 +9493,24 @@ MenuItemMorph.prototype.mouseMove = function () {
|
||||||
};
|
};
|
||||||
|
|
||||||
MenuItemMorph.prototype.mouseClickLeft = function () {
|
MenuItemMorph.prototype.mouseClickLeft = function () {
|
||||||
if (!this.isListItem()) {
|
if (!(this.doubleClickAction instanceof MenuMorph)) {
|
||||||
var topmenu = this.parent;
|
if (!this.isListItem()) {
|
||||||
while (topmenu.parent instanceof MenuMorph) {
|
var topmenu = this.parent;
|
||||||
topmenu = topmenu.parent;
|
while (topmenu.parent instanceof MenuMorph) {
|
||||||
|
topmenu = topmenu.parent;
|
||||||
|
}
|
||||||
|
topmenu.destroy();
|
||||||
|
this.root().activeMenu = null;
|
||||||
}
|
}
|
||||||
topmenu.destroy();
|
this.trigger();
|
||||||
this.root().activeMenu = null;
|
|
||||||
}
|
}
|
||||||
this.trigger();
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
MenuItemMorph.prototype.mouseDoubleClick = function () {
|
||||||
|
if (!(this.doubleClickAction instanceof MenuMorph))
|
||||||
|
this.triggerDoubleClick();
|
||||||
|
}
|
||||||
|
|
||||||
MenuItemMorph.prototype.isListItem = function () {
|
MenuItemMorph.prototype.isListItem = function () {
|
||||||
if (this.parent) {
|
if (this.parent) {
|
||||||
return this.parent.isListContents;
|
return this.parent.isListContents;
|
||||||
|
|
Ładowanie…
Reference in New Issue