mirror of
https://bitbucket.org/bellord13/kit.git
synced 2026-11-13 19:06:11 +03:00
fix
This commit is contained in:
+5
-20
@@ -438,8 +438,7 @@ __PluginManager__.register('menu',function(module, exports, require, global) {
|
||||
this.node = document.createElement('a');
|
||||
this.node.style.position = 'relative';
|
||||
this.node.dataset.parentId = this.parentId;
|
||||
this.node.kit = this.node.kit || {};
|
||||
this.node.kit.menuItem = this;
|
||||
support.setNodeData(this.node, 'menuItem', this);
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -627,23 +626,12 @@ __PluginManager__.register('menu',function(module, exports, require, global) {
|
||||
};
|
||||
|
||||
/**
|
||||
* @param node HTMLElement
|
||||
* @param selector HTMLElement | string
|
||||
* @param content HTMLElement | string
|
||||
* @param isText boolean
|
||||
* @return boolean
|
||||
*/
|
||||
MenuItem.prototype.setContent = function(node, content, isText = false){
|
||||
if(!(node instanceof Element)) {
|
||||
return false;
|
||||
}
|
||||
while (node.firstChild) {
|
||||
node.removeChild(node.firstChild);
|
||||
}
|
||||
if((content instanceof Element) || isText) {
|
||||
node.append(content);
|
||||
} else {
|
||||
node.innerHTML = content;
|
||||
}
|
||||
MenuItem.prototype.setContent = function(selector, content){
|
||||
support.innerHtml(selector, content);
|
||||
return true;
|
||||
};
|
||||
|
||||
@@ -655,10 +643,7 @@ __PluginManager__.register('menu',function(module, exports, require, global) {
|
||||
if(typeof options === 'string') {
|
||||
options = document.querySelector(options);
|
||||
}
|
||||
if((options instanceof HTMLElement) && options.kit && options.kit.menu) {
|
||||
return options.kit.menu;
|
||||
}
|
||||
return new Menu(options, items);
|
||||
return support.getNodeData(options, MENU_PLUGIN_NAME) || new Menu(options, items);
|
||||
};
|
||||
var getActiveMenuDataList = function(){
|
||||
|
||||
|
||||
Reference in New Issue
Block a user