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

Merge pull request #3886 from kazuhitoyokoi/master2

Limit number of ports in function node
This commit is contained in:
Nick O'Leary 2022-10-04 11:00:18 +01:00 committed by GitHub
commit 93c1600980
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -451,11 +451,13 @@
tabs.activateTab("func-tab-body");
$( "#node-input-outputs" ).spinner({
min:0,
min: 0,
max: 500,
change: function(event, ui) {
var value = this.value;
if (!value.match(/^\d+$/)) { value = 1; }
else if (value < this.min) { value = this.min; }
var value = parseInt(this.value);
value = isNaN(value) ? 1 : value;
value = Math.max(value, parseInt($(this).attr("aria-valuemin")));
value = Math.min(value, parseInt($(this).attr("aria-valuemax")));
if (value !== this.value) { $(this).spinner("value", value); }
}
});