From 5a7592a953fbfaafba859fafc7c1ab7f37bccdd1 Mon Sep 17 00:00:00 2001 From: Dave Conway-Jones Date: Sun, 9 Jun 2019 21:53:34 -0400 Subject: [PATCH] Add name to node and flow context view labels slight adjust spacing for context view --- .../@node-red/editor-client/src/js/ui/tab-context.js | 10 +++++++--- .../@node-red/editor-client/src/sass/debug.scss | 2 +- .../@node-red/editor-client/src/sass/tab-info.scss | 4 ++-- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/packages/node_modules/@node-red/editor-client/src/js/ui/tab-context.js b/packages/node_modules/@node-red/editor-client/src/js/ui/tab-context.js index d4554e1f1..c023034dd 100644 --- a/packages/node_modules/@node-red/editor-client/src/js/ui/tab-context.js +++ b/packages/node_modules/@node-red/editor-client/src/js/ui/tab-context.js @@ -186,6 +186,10 @@ RED.sidebar.context = (function() { function updateNode(node,force) { currentNode = node; + if (currentNode && currentNode.hasOwnProperty("name") && currentNode.name.length > 0 ) { + $(nodeSection.title).text(RED._("sidebar.context.node") + ": " + currentNode.name); + } + else { $(nodeSection.title).text(RED._("sidebar.context.node")); } if (force) { if (node) { updateEntry(nodeSection,"context/node/"+node.id,node.id); @@ -211,6 +215,7 @@ RED.sidebar.context = (function() { } function updateFlow(flow, force) { currentFlow = flow; + $(flowSection.title).text(RED._("sidebar.context.flow") + ": " + currentFlow.label); if (force || flowAutoRefresh.prop("checked")) { if (flow) { updateEntry(flowSection,"context/flow/"+flow.id,flow.id); @@ -325,7 +330,6 @@ RED.sidebar.context = (function() { } }); popover.open(); - }); RED.popover.tooltip(deleteItem,RED._("sidebar.context.delete")); var payload = v.msg; @@ -346,6 +350,7 @@ RED.sidebar.context = (function() { $(section.timestamp).text(new Date().toLocaleString()); }); } + function updateEntry(section,baseUrl,id) { var container = section.table; if (id) { @@ -356,11 +361,10 @@ RED.sidebar.context = (function() { } } - - function show() { RED.sidebar.show("context"); } + return { init: init } diff --git a/packages/node_modules/@node-red/editor-client/src/sass/debug.scss b/packages/node_modules/@node-red/editor-client/src/sass/debug.scss index d767aaed3..e8bfe4f34 100644 --- a/packages/node_modules/@node-red/editor-client/src/sass/debug.scss +++ b/packages/node_modules/@node-red/editor-client/src/sass/debug.scss @@ -218,7 +218,7 @@ .red-ui-debug-msg-row { display: block; - padding: 4px 2px 2px; + padding: 2px 2px 2px; position: relative; &.red-ui-debug-msg-row-pinned { background: $secondary-background-selected; diff --git a/packages/node_modules/@node-red/editor-client/src/sass/tab-info.scss b/packages/node_modules/@node-red/editor-client/src/sass/tab-info.scss index bc72f7532..acda4f158 100644 --- a/packages/node_modules/@node-red/editor-client/src/sass/tab-info.scss +++ b/packages/node_modules/@node-red/editor-client/src/sass/tab-info.scss @@ -92,12 +92,12 @@ table.red-ui-info-table tr:not(.blank) td:first-child{ color: $header-text-color; vertical-align: top; width: 90px; - padding: 3px 3px 3px 6px; + padding: 6px 3px 3px 6px; background:$tertiary-background; border-right: 1px solid $secondary-border-color; } table.red-ui-info-table tr:not(.blank) td:last-child{ - padding: 3px 3px 3px 6px; + padding: 5px 3px 3px 6px; color: $primary-text-color; overflow-y: hidden; }