This commit is contained in:
aqu415
2022-02-15 20:53:30 +08:00
parent 4074afd250
commit 2782fda765
3 changed files with 44 additions and 47 deletions
+10 -5
View File
@@ -52,7 +52,7 @@
n.innerHTML = '';
n.appendChild(t);
} else {
n.innerHTML = t.replaceAll('\n','<br>');
n.innerHTML = t.replaceAll('\n', '<br>');
}
};
// detect isElement
@@ -2564,7 +2564,7 @@
}
d.setAttribute('nodeid', node.id);
d.style.visibility = 'hidden';
this._reset_node_custom_style(d, node.data);
this._reset_node_custom_style(node, d, node.data);
parent_node.appendChild(d);
view_data.element = d;
@@ -2826,10 +2826,10 @@
},
reset_node_custom_style: function (node) {
this._reset_node_custom_style(node._data.view.element, node.data);
this._reset_node_custom_style(node, node._data.view.element, node.data);
},
_reset_node_custom_style: function (node_element, node_data) {
_reset_node_custom_style: function (node, node_element, node_data) {
if ('background-color' in node_data) {
node_element.style.backgroundColor = node_data['background-color'];
}
@@ -2842,8 +2842,13 @@
if ('height' in node_data) {
node_element.style.height = node_data['height'] + 'px';
}
if ('font-size' in node_data) {
/*if ('font-size' in node_data) {
node_element.style.fontSize = node_data['font-size'] + 'px';
}*/
if (node.isroot) {
node_element.style.backgroundColor = '#289f45'
} else {
node_element.style.fontSize = '12px';
}
if ('font-weight' in node_data) {
node_element.style.fontWeight = node_data['font-weight'];