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