diff --git a/bin/Controls/Independent/MenuPanel.js b/bin/Controls/Independent/MenuPanel.js index 48cc231fe8375443ceaa7ce6451344ad944b4e43..40ef740c7fd2fcdd7e0d47d3bc2f932f28ee16c4 100644 --- a/bin/Controls/Independent/MenuPanel.js +++ b/bin/Controls/Independent/MenuPanel.js @@ -79,7 +79,9 @@ define('package/quiqqer/menu/bin/Controls/Independent/MenuPanel', [ name : 'add', text : QUILocale.get('quiqqer/quiqqer', 'add'), events: { - click: this.addItem + click: () => { + this.addItem(); + } } }); @@ -113,7 +115,7 @@ define('package/quiqqer/menu/bin/Controls/Independent/MenuPanel', [ this.setAttribute('title', menuData.title); this.setAttribute('icon', 'fa fa-bars'); this.refresh(); - console.warn('init', menuData); + //console.warn('init', menuData); // build sitemap if (menuData.data !== null && typeof menuData.data.children !== 'undefined' && @@ -193,7 +195,7 @@ define('package/quiqqer/menu/bin/Controls/Independent/MenuPanel', [ let result = toArray(this.$Map); let title = null; let workingTitle = null; - console.log('save', result); + //console.log('save', result); Handler.saveMenu( this.getAttribute('menuId'), title, @@ -214,6 +216,8 @@ define('package/quiqqer/menu/bin/Controls/Independent/MenuPanel', [ if (items.length) { Parent = items[0]; + } else { + Parent = this.$Map; } } @@ -287,7 +291,10 @@ define('package/quiqqer/menu/bin/Controls/Independent/MenuPanel', [ if (where === 'bottom') { Parent.appendChild(new QUIMapItem(itemAttributes)); - Parent.open(); + + if (typeof Parent === 'function') { + Parent.open(); + } } else { Parent.appendChild(new QUIMapItem(itemAttributes), where); }