mirror of
https://github.com/node-red/node-red.git
synced 2025-03-01 10:36:34 +00:00
Fix name auto-generator to leave blank names alone on copy/paste
This commit is contained in:
@@ -74,7 +74,7 @@
|
||||
RED.nodes.registerType('debug',{
|
||||
category: 'common',
|
||||
defaults: {
|
||||
name: {value:""},
|
||||
name: {value:"_"},
|
||||
active: {value:true},
|
||||
tosidebar: {value:true},
|
||||
console: {value:false},
|
||||
@@ -546,7 +546,10 @@
|
||||
$("#node-input-statusVal").val($("#node-input-typed-status").typedInput('value'));
|
||||
},
|
||||
onadd: function() {
|
||||
RED.actions.invoke("core:generate-node-names",this)
|
||||
if (this.name === '_') {
|
||||
this.name = ''
|
||||
RED.actions.invoke("core:generate-node-names", this)
|
||||
}
|
||||
}
|
||||
});
|
||||
})();
|
||||
|
@@ -218,7 +218,10 @@
|
||||
}
|
||||
|
||||
function onAdd() {
|
||||
RED.actions.invoke("core:generate-node-names",this)
|
||||
if (this.name === '_') {
|
||||
this.name = ''
|
||||
RED.actions.invoke("core:generate-node-names", this)
|
||||
}
|
||||
|
||||
for (var i=0;i<this.links.length;i++) {
|
||||
var n = RED.nodes.node(this.links[i]);
|
||||
@@ -232,7 +235,7 @@
|
||||
category: 'common',
|
||||
color:"#ddd",//"#87D8CF",
|
||||
defaults: {
|
||||
name: {value:""},
|
||||
name: { value: "_" },
|
||||
links: { value: [], type:"link out[]" }
|
||||
},
|
||||
inputs:0,
|
||||
@@ -268,9 +271,9 @@
|
||||
category: 'common',
|
||||
color:"#ddd",//"#87D8CF",
|
||||
defaults: {
|
||||
name: {value:""},
|
||||
links: { value: [], type:"link in[]"},
|
||||
linkType: {value:"static"},
|
||||
name: { value: "_" },
|
||||
links: { value: [], type:"link in[]" },
|
||||
linkType: { value:"static" },
|
||||
timeout: { value: "30", validate:RED.validators.number(true) }
|
||||
},
|
||||
inputs: 1,
|
||||
@@ -318,7 +321,10 @@
|
||||
},
|
||||
oneditresize: resizeNodeList,
|
||||
onadd: function() {
|
||||
RED.actions.invoke("core:generate-node-names",this)
|
||||
if (this.name === '_') {
|
||||
this.name = ''
|
||||
RED.actions.invoke("core:generate-node-names", this)
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
@@ -326,9 +332,9 @@
|
||||
category: 'common',
|
||||
color:"#ddd",//"#87D8CF",
|
||||
defaults: {
|
||||
name: {value:""},
|
||||
name: { value:"_" },
|
||||
mode: { value: "link" },// link || return
|
||||
links: { value: [], type:"link in[]"}
|
||||
links: { value: [], type:"link in[]" }
|
||||
},
|
||||
align:"right",
|
||||
inputs:1,
|
||||
|
Reference in New Issue
Block a user