diff --git a/assets/menu/menu.js b/assets/menu/menu.js index 255710f..237dc48 100644 --- a/assets/menu/menu.js +++ b/assets/menu/menu.js @@ -423,7 +423,7 @@ __PluginManager__.register('menu',function(module, exports, require) { }; Menu.prototype.reInit = function (recursiveCalcStyle = false) { - // console.warn('Menu: reInit ' + this.id); + console.warn('Menu: reInit ' + this.id); if(this.bInit === false) { return; } @@ -432,14 +432,15 @@ __PluginManager__.register('menu',function(module, exports, require) { this.removeParentEventListener(); //this.removeDocumentEventListener(); - this.removeAnimation(); + //this.removeAnimation(); - this.node.remove(); + if(this.node.parentElement !== this.options.parent) { + this.node.remove(); + this.options.parent.prepend(this.getNode()); + } this.render(); - this.options.parent.prepend(this.getNode()); - if(this.bActive) { this.calcStyle(recursiveCalcStyle); this.showNode(); @@ -830,7 +831,7 @@ __PluginManager__.register('menu',function(module, exports, require) { return Menu; })(); var getInstance = function(options = {}, items = []) { - if(options instanceof Menu) { + if(options instanceof MenuClass) { return options; } if(typeof options === 'string') { diff --git a/tests/index.php b/tests/index.php new file mode 100644 index 0000000..968223a --- /dev/null +++ b/tests/index.php @@ -0,0 +1,9 @@ +
\ No newline at end of file