fix so you can't click item that opens submenu

pull/29/head
brianharvey 2016-12-26 20:55:43 -08:00
rodzic ac9fad3af2
commit 51aa5db3b0
1 zmienionych plików z 18 dodań i 9 usunięć

Wyświetl plik

@ -9479,8 +9479,10 @@ MenuItemMorph.prototype.mouseDownLeft = function (pos) {
if (this.isListItem()) {
this.parent.unselectAllItems();
this.escalateEvent('mouseDownLeft', pos);
}
this.image = this.pressImage;
this.image = this.pressImage;
} else if (!(this.doubleClickAction instanceof MenuMorph)) {
this.image = this.pressImage;
}
this.changed();
};
@ -9491,17 +9493,24 @@ MenuItemMorph.prototype.mouseMove = function () {
};
MenuItemMorph.prototype.mouseClickLeft = function () {
if (!this.isListItem()) {
var topmenu = this.parent;
while (topmenu.parent instanceof MenuMorph) {
topmenu = topmenu.parent;
if (!(this.doubleClickAction instanceof MenuMorph)) {
if (!this.isListItem()) {
var topmenu = this.parent;
while (topmenu.parent instanceof MenuMorph) {
topmenu = topmenu.parent;
}
topmenu.destroy();
this.root().activeMenu = null;
}
topmenu.destroy();
this.root().activeMenu = null;
this.trigger();
}
this.trigger();
};
MenuItemMorph.prototype.mouseDoubleClick = function () {
if (!(this.doubleClickAction instanceof MenuMorph))
this.triggerDoubleClick();
}
MenuItemMorph.prototype.isListItem = function () {
if (this.parent) {
return this.parent.isListContents;