Skip to content

Commit d7d30aa

Browse files
committed
Default config nodes to global scope unless in a subflow
Closes node-red#972
1 parent 91c23d1 commit d7d30aa

3 files changed

Lines changed: 7 additions & 6 deletions

File tree

editor/js/ui/editor.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -776,16 +776,17 @@ RED.editor = (function() {
776776
} else {
777777
ns = node_def.set.id;
778778
}
779-
var activeWorkspace = RED.nodes.workspace(RED.workspaces.active());
780-
if (!activeWorkspace) {
781-
activeWorkspace = RED.nodes.subflow(RED.workspaces.active());
779+
var configNodeScope = ""; // default to global
780+
var activeSubflow = RED.nodes.subflow(RED.workspaces.active());
781+
if (activeSubflow) {
782+
configNodeScope = activeSubflow.id;
782783
}
783784
if (editing_config_node == null) {
784785
editing_config_node = {
785786
id: RED.nodes.id(),
786787
_def: node_def,
787788
type: type,
788-
z: activeWorkspace.id,
789+
z: configNodeScope,
789790
users: []
790791
}
791792
for (var d in node_def.defaults) {

editor/sass/editor.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@
255255
margin: 1px 0 0 0;
256256
padding: 0;
257257
height: 22px;
258-
width: 150px;
258+
width: 200px;
259259

260260
}
261261
#node-config-dialog-user-count {

red/api/locales/en-US/editor.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@
267267
"config": {
268268
"name": "Configuration nodes",
269269
"label": "config",
270-
"global": "Global",
270+
"global": "On all flows",
271271
"none": "none",
272272
"subflows": "subflows",
273273
"flows": "flows",

0 commit comments

Comments
 (0)