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 {
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) {

View File

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

View File

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