1
0
mirror of https://github.com/node-red/node-red.git synced 2023-10-10 13:36:53 +02:00

Default config nodes to global scope unless in a subflow

Closes #972
This commit is contained in:
Nick O'Leary 2016-08-26 13:26:42 +01:00
parent 91c23d1f7d
commit d7d30aa972
3 changed files with 7 additions and 6 deletions

View File

@ -776,16 +776,17 @@ RED.editor = (function() {
} else { } else {
ns = node_def.set.id; ns = node_def.set.id;
} }
var activeWorkspace = RED.nodes.workspace(RED.workspaces.active()); var configNodeScope = ""; // default to global
if (!activeWorkspace) { var activeSubflow = RED.nodes.subflow(RED.workspaces.active());
activeWorkspace = RED.nodes.subflow(RED.workspaces.active()); if (activeSubflow) {
configNodeScope = activeSubflow.id;
} }
if (editing_config_node == null) { if (editing_config_node == null) {
editing_config_node = { editing_config_node = {
id: RED.nodes.id(), id: RED.nodes.id(),
_def: node_def, _def: node_def,
type: type, type: type,
z: activeWorkspace.id, z: configNodeScope,
users: [] users: []
} }
for (var d in node_def.defaults) { for (var d in node_def.defaults) {

View File

@ -255,7 +255,7 @@
margin: 1px 0 0 0; margin: 1px 0 0 0;
padding: 0; padding: 0;
height: 22px; height: 22px;
width: 150px; width: 200px;
} }
#node-config-dialog-user-count { #node-config-dialog-user-count {

View File

@ -267,7 +267,7 @@
"config": { "config": {
"name": "Configuration nodes", "name": "Configuration nodes",
"label": "config", "label": "config",
"global": "Global", "global": "On all flows",
"none": "none", "none": "none",
"subflows": "subflows", "subflows": "subflows",
"flows": "flows", "flows": "flows",