提交
This commit is contained in:
@ -1312,9 +1312,13 @@
|
||||
makeDOMNodeIcon: function (html, setting, node) {
|
||||
var nameStr = data.nodeName(setting, node),
|
||||
name = setting.view.nameIsHTML ? nameStr : nameStr.replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>');
|
||||
let svg='';
|
||||
if(node.svg) {
|
||||
svg = node.svg
|
||||
}
|
||||
html.push("<span id='", node.tId, consts.id.ICON,
|
||||
"' title='' treeNode", consts.id.ICON, " class='", view.makeNodeIcoClass(setting, node),
|
||||
"' style='", view.makeNodeIcoStyle(setting, node), "'></span><span id='", node.tId, consts.id.SPAN,
|
||||
"' style='", view.makeNodeIcoStyle(setting, node), `'>${svg}</span><span id='`, node.tId, consts.id.SPAN,
|
||||
"' class='", consts.className.NAME,
|
||||
"'>", name, "</span>");
|
||||
},
|
||||
@ -1372,11 +1376,12 @@
|
||||
return consts.className.BUTTON + " " + icoCss.join('_');
|
||||
},
|
||||
makeNodeIcoStyle: function (setting, node) {
|
||||
console.log('node', node);
|
||||
var icoStyle = [];
|
||||
if (!node.isAjaxing) {
|
||||
var isParent = data.nodeIsParent(setting, node);
|
||||
var icon = (isParent && node.iconOpen && node.iconClose) ? (node.open ? node.iconOpen : node.iconClose) : node[setting.data.key.icon];
|
||||
if (icon) icoStyle.push("background:url(", icon, ") 0 0 no-repeat;");
|
||||
if (icon || node.svg) icoStyle.push("background:url(", (node.svg ? '':icon), ") 0 0 no-repeat;");
|
||||
if (setting.view.showIcon == false || !tools.apply(setting.view.showIcon, [setting.treeId, node], true)) {
|
||||
icoStyle.push("display:none;");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user