mirror of
https://github.com/node-red/node-red.git
synced 2023-10-10 13:36:53 +02:00
Nodes with hasUsers set to false should not appear unused
This commit is contained in:
parent
4b64aad5ce
commit
a03ccd7b59
@ -113,7 +113,7 @@ RED.sidebar.config = (function() {
|
||||
if (showUnusedOnly) {
|
||||
var hiddenCount = nodes.length;
|
||||
nodes = nodes.filter(function(n) {
|
||||
return n.users.length === 0;
|
||||
return n._def.hasUsers!==false && n.users.length === 0;
|
||||
})
|
||||
hiddenCount = hiddenCount - nodes.length;
|
||||
if (hiddenCount > 0) {
|
||||
@ -151,11 +151,12 @@ RED.sidebar.config = (function() {
|
||||
|
||||
var entry = $('<li class="palette_node config_node palette_node_id_'+node.id.replace(/\./g,"-")+'"></li>').appendTo(list);
|
||||
$('<div class="palette_label"></div>').text(label).appendTo(entry);
|
||||
|
||||
if (node._def.hasUsers !== false) {
|
||||
var iconContainer = $('<div/>',{class:"palette_icon_container palette_icon_container_right"}).text(node.users.length).appendTo(entry);
|
||||
if (node.users.length === 0) {
|
||||
entry.addClass("config_node_unused");
|
||||
}
|
||||
}
|
||||
entry.on('click',function(e) {
|
||||
RED.sidebar.info.refresh(node);
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user