This commit is contained in:
2021-10-05 23:13:01 +03:00
parent a0a6a9b710
commit 9b0dcbcb80
4 changed files with 317 additions and 117 deletions
+5 -11
View File
@@ -206,17 +206,10 @@ __PluginManager__.register('menu',function(module, exports, require) {
* @return {Menu} | null
*/
Menu.prototype.getParentMenu = function() {
if(this.getParent() && this.getParent().kitMenuItem) {
return this.getParent().kitMenuItem.getMenu();
var p = this.getParent();
if(p instanceof Element && p.hasOwnProperty('kit') && p.kit.menuItem instanceof MenuItemClass) {
return p.kit.menuItem.getMenu();
}
return undefined;
if(
this.getParent() && (this.getParent() instanceof Element) &&
this.getParent().hasOwnProperty('kitMenuItem') && (this.getParent().kitMenuItem instanceof MenuItemClass)
) {
return this.getParent().kitMenuItem.getMenu();
}
return undefined;
};
Menu.prototype.getParentMenuNode = function() {
var parentMenu = this.getParentMenu(),
@@ -586,7 +579,8 @@ __PluginManager__.register('menu',function(module, exports, require) {
this.node = document.createElement('a');
this.node.style.position = 'relative';
this.node.dataset.parentId = this.parentId;
this.node.kitMenuItem = this;
this.node.kit = this.node.kit || {};
this.node.kit.menuItem = this;
};
/**