1
0
Fork 0
mirror of https://github.com/iNavFlight/inav-configurator.git synced 2025-07-24 16:55:22 +03:00

Add support for configuring coordinate digit count on OSD

Depends on https://github.com/iNavFlight/inav/pull/3573
This commit is contained in:
Alberto García Hierro 2018-07-12 00:51:34 +01:00
parent fc0c8123da
commit 142e960893
4 changed files with 38 additions and 4 deletions

View file

@ -11,6 +11,20 @@ var Settings = (function () {
return Promise.mapSeries(inputs, function (input, ii) {
var settingName = input.data('setting');
return mspHelper.getSetting(settingName).then(function (s) {
// Check if the input declares a parent
// to be hidden in case of the setting not being available.
// Otherwise, default to hiding its parent
var parent = input.parents('.setting-container:first');
if (parent.length == 0) {
parent = input.parent();
}
if (!s) {
// Setting doesn't exist.
input.val(null);
parent.hide();
return;
}
parent.show();
if (input.prop('tagName') == 'SELECT' || s.setting.table) {
if (input.attr('type') == 'checkbox') {
input.prop('checked', s.value > 0);