From a03ccd7b59fd3d5cb095d1c02bcfd9e9d708ce63 Mon Sep 17 00:00:00 2001 From: Nick O'Leary Date: Sun, 15 Jan 2017 13:37:21 +0000 Subject: [PATCH] Nodes with hasUsers set to false should not appear unused --- editor/js/ui/tab-config.js | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/editor/js/ui/tab-config.js b/editor/js/ui/tab-config.js index 3b5c2418c..5041d4433 100644 --- a/editor/js/ui/tab-config.js +++ b/editor/js/ui/tab-config.js @@ -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,10 +151,11 @@ RED.sidebar.config = (function() { var entry = $('
  • ').appendTo(list); $('
    ').text(label).appendTo(entry); - - var iconContainer = $('
    ',{class:"palette_icon_container palette_icon_container_right"}).text(node.users.length).appendTo(entry); - if (node.users.length === 0) { - entry.addClass("config_node_unused"); + if (node._def.hasUsers !== false) { + var iconContainer = $('
    ',{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);