Spinner fixes (#1371)

* Fix for function node invalid spinner values

to close #1370

* better validation of spinners for inject and delay

(don’t allow negative numbers)

* remove need for declaring local min variable
This commit is contained in:
Dave Conway-Jones
2017-08-21 22:00:23 +01:00
committed by Nick O'Leary
parent e09efba313
commit a844ca161f
3 changed files with 12 additions and 6 deletions

View File

@@ -73,7 +73,13 @@
oneditprepare: function() {
var that = this;
$( "#node-input-outputs" ).spinner({
min:1
min:1,
change: function(event, ui) {
var value = this.value;
if (!value.match(/^\d+$/)) { value = 1; }
else if (value < this.min) { value = this.min; }
if (value !== this.value) { $(this).spinner("value", value); }
}
});
this.editor = RED.editor.createEditor({