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:
parent
02ea424b9b
commit
394aa18e6c
1 changed files with 8 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue