rework slideup menus to use shared components
This commit is contained in:
parent
7323e865f2
commit
63efbfc838
28 changed files with 521 additions and 392 deletions
|
@ -7,7 +7,7 @@
|
|||
while (!elem.getAttribute(name)) {
|
||||
elem = elem.parentNode;
|
||||
|
||||
if (!elem) {
|
||||
if (!elem || !elem.getAttribute) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
@ -62,6 +62,26 @@
|
|||
};
|
||||
}
|
||||
|
||||
ItemsContainerProtoType.enableHoverMenu = function (enabled) {
|
||||
|
||||
var current = this.hoverMenu;
|
||||
|
||||
if (!enabled && current) {
|
||||
current.destroy();
|
||||
this.hoverMenu = null;
|
||||
return;
|
||||
}
|
||||
|
||||
if (current) {
|
||||
return;
|
||||
}
|
||||
|
||||
var self = this;
|
||||
require(['itemHoverMenu'], function (ItemHoverMenu) {
|
||||
self.hoverMenu = new ItemHoverMenu(self);
|
||||
});
|
||||
};
|
||||
|
||||
ItemsContainerProtoType.attachedCallback = function () {
|
||||
this.addEventListener('click', onClick);
|
||||
|
||||
|
@ -73,6 +93,10 @@
|
|||
this.addEventListener('contextmenu', onContextMenu);
|
||||
}
|
||||
|
||||
if (layoutManager.desktop) {
|
||||
this.enableHoverMenu(true);
|
||||
}
|
||||
|
||||
itemShortcuts.on(this, getShortcutOptions());
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue