Improve red-ui-node-icon css and add red-ui-node-icon-small modifier class

This commit is contained in:
Nick O'Leary
2021-05-13 13:39:29 +01:00
parent 4ff991764e
commit 1a30fe4a1a
3 changed files with 31 additions and 15 deletions

View File

@@ -1133,6 +1133,8 @@ RED.utils = (function() {
}
function createNodeIcon(node, includeLabel) {
var container = $('<span class="red-ui-node-icon-container">');
var def = node._def;
var nodeDiv = $('<div>',{class:"red-ui-node-icon"})
if (node.type === "_selection_") {
@@ -1156,9 +1158,9 @@ RED.utils = (function() {
var icon_url = RED.utils.getNodeIcon(def,node);
RED.utils.createIconElement(icon_url, nodeDiv, true);
nodeDiv.appendTo(container);
if (includeLabel) {
var container = $('<span>');
nodeDiv.appendTo(container);
var labelText = RED.utils.getNodeLabel(node,node.name || (node.type+": "+node.id));
var label = $('<div>',{class:"red-ui-node-label"}).appendTo(container);
if (labelText) {
@@ -1166,9 +1168,8 @@ RED.utils = (function() {
} else {
label.html("&nbsp;")
}
return container;
}
return nodeDiv;
return container;
}
function getDarkerColor(c) {