Skip to content

Commit 93c1600

Browse files
authored
Merge pull request node-red#3886 from kazuhitoyokoi/master2
Limit number of ports in function node
2 parents c3d1e61 + ce31edc commit 93c1600

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

packages/node_modules/@node-red/nodes/core/function/10-function.html

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -451,11 +451,13 @@
451451
tabs.activateTab("func-tab-body");
452452

453453
$( "#node-input-outputs" ).spinner({
454-
min:0,
454+
min: 0,
455+
max: 500,
455456
change: function(event, ui) {
456-
var value = this.value;
457-
if (!value.match(/^\d+$/)) { value = 1; }
458-
else if (value < this.min) { value = this.min; }
457+
var value = parseInt(this.value);
458+
value = isNaN(value) ? 1 : value;
459+
value = Math.max(value, parseInt($(this).attr("aria-valuemin")));
460+
value = Math.min(value, parseInt($(this).attr("aria-valuemax")));
459461
if (value !== this.value) { $(this).spinner("value", value); }
460462
}
461463
});

0 commit comments

Comments
 (0)