mirror of
https://github.com/node-red/node-red.git
synced 2023-10-10 13:36:53 +02:00
Allow RED.validators.number to allow blank values as valid
This commit is contained in:
parent
e27f5d0460
commit
68e0b35364
@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
**/
|
||||
RED.validators = {
|
||||
number: function(){return function(v) { return v!=='' && !isNaN(v);}},
|
||||
number: function(blankAllowed){return function(v) { return (blankAllowed&&v==='') || (v!=='' && !isNaN(v));}},
|
||||
regex: function(re){return function(v) { return re.test(v);}},
|
||||
typedInput: function(ptypeName,isConfig) { return function(v) {
|
||||
var ptype = $("#node-"+(isConfig?"config-":"")+"input-"+ptypeName).val() || this[ptypeName];
|
||||
|
Loading…
Reference in New Issue
Block a user