From 54ba2228302dc7b9a81786ebd577343e5334314d Mon Sep 17 00:00:00 2001 From: HThuren <99370924+HThuren@users.noreply.github.com> Date: Fri, 6 Jan 2023 01:24:39 +0100 Subject: [PATCH] Sort of 3 optionlist at failsafe tab (#3211) Sort of 3 optionlist --- src/js/tabs/failsafe.js | 8 ++++++++ src/tabs/failsafe.html | 6 +++--- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/src/js/tabs/failsafe.js b/src/js/tabs/failsafe.js index e8157aae..da4d903e 100644 --- a/src/js/tabs/failsafe.js +++ b/src/js/tabs/failsafe.js @@ -249,6 +249,9 @@ failsafe.initialize = function (callback) { break; } + // Sort the element, if need to group, do it by lexical sort, ie. by naming of (the translated) selection text + $('#failsafeSwitchSelect').sortSelect(); + // `failsafe_kill_switch` has been renamed to `failsafe_switch_mode`. // It is backwards compatible with `failsafe_kill_switch` $('select[name="failsafe_switch_mode"]').val(FC.FAILSAFE_CONFIG.failsafe_switch_mode); @@ -265,8 +268,13 @@ failsafe.initialize = function (callback) { $('input[name="gps_rescue_throttle_max"]').val(FC.GPS_RESCUE.throttleMax); $('input[name="gps_rescue_throttle_hover"]').val(FC.GPS_RESCUE.throttleHover); $('input[name="gps_rescue_min_sats"]').val(FC.GPS_RESCUE.minSats); + // Sort the element, if need to group, do it by lexical sort, ie. by naming of (the translated) selection text + $('#failsafeGpsRescueItemSanitySelect').sortSelect(); $('select[name="gps_rescue_sanity_checks"]').val(FC.GPS_RESCUE.sanityChecks); + // Sort the element, if need to group, do it by lexical sort, ie. by naming of (the translated) selection text + $('#failsafeGpsRescueItemAltitudeSelect').sortSelect(); + if (semver.gte(FC.CONFIG.apiVersion, API_VERSION_1_43)) { $('input[name="gps_rescue_ascend_rate"]').val((FC.GPS_RESCUE.ascendRate / 100).toFixed(2)); $('input[name="gps_rescue_descend_rate"]').val((FC.GPS_RESCUE.descendRate / 100).toFixed(2)); diff --git a/src/tabs/failsafe.html b/src/tabs/failsafe.html index 383d316f..0fea81b1 100644 --- a/src/tabs/failsafe.html +++ b/src/tabs/failsafe.html @@ -47,7 +47,7 @@