From 1c655b5945543d25a2ae9d290ecfafdc3a662a29 Mon Sep 17 00:00:00 2001 From: Nick O'Leary Date: Thu, 27 Feb 2014 16:47:28 +0000 Subject: [PATCH] Missed sidebar api changes --- public/red/nodes.js | 4 ++-- public/red/ui/tab-info.js | 17 +++++++++++++++++ public/red/ui/view.js | 18 +----------------- 3 files changed, 20 insertions(+), 19 deletions(-) diff --git a/public/red/nodes.js b/public/red/nodes.js index 9d56153e8..34f2ed32b 100644 --- a/public/red/nodes.js +++ b/public/red/nodes.js @@ -86,7 +86,7 @@ RED.nodes = function() { var removedLinks = []; if (id in configNodes) { delete configNodes[id]; - RED.configTab.refresh(); + RED.sidebar.config.refresh(); } else { var node = getNode(id); if (node) { @@ -110,7 +110,7 @@ RED.nodes = function() { } } if (updatedConfigNode) { - RED.configTab.refresh(); + RED.sidebar.config.refresh(); } } return removedLinks; diff --git a/public/red/ui/tab-info.js b/public/red/ui/tab-info.js index 1fdb18d76..9693dce2f 100644 --- a/public/red/ui/tab-info.js +++ b/public/red/ui/tab-info.js @@ -23,6 +23,23 @@ RED.sidebar.info = function() { RED.sidebar.addTab("info",content); + function jsonFilter(key,value) { + if (key == "") { + return value; + } + var t = typeof value; + if ($.isArray(value)) { + return "[array:"+value.length+"]"; + } else if (t === "object") { + return "[object]" + } else if (t === "string") { + if (value.length > 30) { + return value.substring(0,30)+" ..."; + } + } + return value; + } + function refresh(node) { var table = ''; diff --git a/public/red/ui/view.js b/public/red/ui/view.js index e0c4506de..f0686920b 100644 --- a/public/red/ui/view.js +++ b/public/red/ui/view.js @@ -521,23 +521,7 @@ RED.view = function() { } } - function jsonFilter(key,value) { - if (key == "") { - return value; - } - var t = typeof value; - if ($.isArray(value)) { - return "[array:"+value.length+"]"; - } else if (t === "object") { - return "[object]" - } else if (t === "string") { - if (value.length > 30) { - return value.substring(0,30)+" ..."; - } - } - return value; - } - + function calculateTextWidth(str) { var sp = document.createElement("span"); sp.className = "node_label";