Skip to content

Commit

Permalink
NumericStepper - Fix that max and min reset are not detected by toolb…
Browse files Browse the repository at this point in the history
…ox.js

 - change does not fire in those cases, so use blur as well
  • Loading branch information
torinfo committed Aug 4, 2024
1 parent 8968a2e commit 537d7ae
Showing 1 changed file with 25 additions and 1 deletion.
26 changes: 25 additions & 1 deletion editor/js/toolbox.js
Original file line number Diff line number Diff line change
Expand Up @@ -4062,7 +4062,31 @@ var EDITOR = (function ($, parent) {
this.value = min;
}
}
});
})
.blur({id:id, key:key, name:name, trigger:conditionTrigger}, function(event) {
if ((isNaN(max) || this.value <= max) && (isNaN(min) || this.value >= min)) {
if (this.value == '') {
if (isNaN(max) || isNaN(min)) {
this.value = 0;
} else {
this.value = (min + max) / 2; // choose midpoint for NaN
}
}
inputChanged(event.data.id, event.data.key, event.data.name, this.value, this);
if (event.data.trigger)
{
triggerRedrawPage(event.data.key);
}
}
else { // set to max or min if out of range
if (this.value > max) {
this.value = max;
} else {
this.value = min;
}
}
});

}
break;
case 'pagelist':
Expand Down

0 comments on commit 537d7ae

Please sign in to comment.