1
0
Fork 0
mirror of https://github.com/iNavFlight/inav-configurator.git synced 2025-07-23 16:25:19 +03:00

Adds min and max limits to all numerical fields

This adds min and max limits to all numerical fields; if they use the data-setting method. This doesn't cover the old MSP fields.
This commit is contained in:
Darren Lines 2022-01-09 16:24:45 +00:00
parent 02ea424b9b
commit 394aa18e6c

View file

@ -71,6 +71,14 @@ var Settings = (function () {
var multiplier = parseFloat(input.data('setting-multiplier') || 1);
input.attr('type', 'number');
input.val((s.value / multiplier).toFixed(Math.log10(multiplier)));
if (s.setting.min) {
input.attr('min', (s.setting.min / multiplier).toFixed(Math.log10(multiplier)));
}
if (s.setting.max) {
input.attr('max', (s.setting.max / multiplier).toFixed(Math.log10(multiplier)));
}
}
// If data is defined, We want to convert this value into