1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-16 12:55:19 +03:00

bugfixes for primary input validation

This commit is contained in:
cTn 2014-09-22 10:16:27 +02:00
parent 92581335a1
commit 5cc88b26c4

View file

@ -220,6 +220,7 @@ $(document).ready(function () {
if (element.prop('min')) {
if (val < min) {
element.val(min);
val = min;
}
}
@ -227,18 +228,21 @@ $(document).ready(function () {
if (element.prop('max')) {
if (val > max) {
element.val(max);
val = max;
}
}
// if entered value is illegal use previous value instead
if (isNaN(val)) {
element.val(element.data('previousValue'));
val = element.data('previousValue');
}
// if step is not set or step is int and value is float use previous value instead
if (isNaN(step) || step % 1 === 0) {
if (val % 1 !== 0) {
element.val(element.data('previousValue'));
val = element.data('previousValue');
}
}