From d7d30aa9725ad532c49444f0b1bc44b4cb0835fe Mon Sep 17 00:00:00 2001 From: Nick O'Leary Date: Fri, 26 Aug 2016 13:26:42 +0100 Subject: [PATCH] Default config nodes to global scope unless in a subflow Closes #972 --- editor/js/ui/editor.js | 9 +++++---- editor/sass/editor.scss | 2 +- red/api/locales/en-US/editor.json | 2 +- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/editor/js/ui/editor.js b/editor/js/ui/editor.js index c36c54363..31dab88c3 100644 --- a/editor/js/ui/editor.js +++ b/editor/js/ui/editor.js @@ -776,16 +776,17 @@ RED.editor = (function() { } else { ns = node_def.set.id; } - var activeWorkspace = RED.nodes.workspace(RED.workspaces.active()); - if (!activeWorkspace) { - activeWorkspace = RED.nodes.subflow(RED.workspaces.active()); + var configNodeScope = ""; // default to global + var activeSubflow = RED.nodes.subflow(RED.workspaces.active()); + if (activeSubflow) { + configNodeScope = activeSubflow.id; } if (editing_config_node == null) { editing_config_node = { id: RED.nodes.id(), _def: node_def, type: type, - z: activeWorkspace.id, + z: configNodeScope, users: [] } for (var d in node_def.defaults) { diff --git a/editor/sass/editor.scss b/editor/sass/editor.scss index 8b727426c..8b40403b5 100644 --- a/editor/sass/editor.scss +++ b/editor/sass/editor.scss @@ -255,7 +255,7 @@ margin: 1px 0 0 0; padding: 0; height: 22px; - width: 150px; + width: 200px; } #node-config-dialog-user-count { diff --git a/red/api/locales/en-US/editor.json b/red/api/locales/en-US/editor.json index ed3e29607..68eb72fa7 100644 --- a/red/api/locales/en-US/editor.json +++ b/red/api/locales/en-US/editor.json @@ -267,7 +267,7 @@ "config": { "name": "Configuration nodes", "label": "config", - "global": "Global", + "global": "On all flows", "none": "none", "subflows": "subflows", "flows": "flows",