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

Adding a validator to the timeout field and included the timeout in the lable by default

This commit is contained in:
Ben Hardill 2013-09-08 12:18:14 +01:00
parent d13a569c49
commit e255cf7659

View File

@ -40,13 +40,13 @@
color:"#E6E0F8",
defaults: { // defines the editable properties of the node
name: {value:""}, // along with default values.
timeout: {value:"5", required:true}
timeout: {value:"5", required:true, validate:RED.validators.number()}
},
inputs:1, // set the number of inputs - only 0 or 1
outputs:1, // set the number of outputs - 0 to n
icon: "arrow-in.png", // set the icon (held in public/icons)
label: function() { // sets the default label contents
return this.name||this.topic||"pause";
return this.name||this.topic||"pause "+this.timeout+" s";
},
labelStyle: function() { // sets the class to apply to the label
return this.name?"node_label_italic":"";