From 8dc2897a1364924975c691311fbc337836c3150c Mon Sep 17 00:00:00 2001 From: Mark Haslinghuis Date: Mon, 24 Feb 2025 23:13:41 +0100 Subject: [PATCH] Need expert mode for reset (#4357) * Need expert mode for reset * Change verbiage and remove unused parameter --- locales/en/messages.json | 2 +- src/js/tabs/setup.js | 19 ++++++++++++++----- src/tabs/setup.html | 4 ++-- 3 files changed, 17 insertions(+), 8 deletions(-) diff --git a/locales/en/messages.json b/locales/en/messages.json index 8022ab80..fd0fc4b9 100755 --- a/locales/en/messages.json +++ b/locales/en/messages.json @@ -830,7 +830,7 @@ "message": "Calibrating..." }, "initialSetupButtonReset": { - "message": "Reset Settings" + "message": "Erase Settings" }, "initialSetupResetText": { "message": "Reset the flight controller to an unconfigured state." diff --git a/src/js/tabs/setup.js b/src/js/tabs/setup.js index fa15264d..c6e73e92 100644 --- a/src/js/tabs/setup.js +++ b/src/js/tabs/setup.js @@ -73,11 +73,8 @@ setup.initialize = function (callback) { $("#arming-disable-flag").attr("title", i18n.getMessage("initialSetupArmingDisableFlagsTooltip")); - if (isExpertModeEnabled()) { - $(".initialSetupRebootBootloader").show(); - } else { - $(".initialSetupRebootBootloader").hide(); - } + $(".initialSetupReset").toggle(isExpertModeEnabled()); + $(".initialSetupRebootBootloader").toggle(isExpertModeEnabled()); $("a.rebootBootloader").click(function () { const buffer = []; @@ -595,6 +592,18 @@ setup.cleanup = function (callback) { if (callback) callback(); }; +setup.expertModeChanged = function () { + this.refresh(); +}; + +setup.refresh = function () { + const self = this; + + GUI.tab_switch_cleanup(function () { + self.initialize(); + }); +}; + TABS.setup = setup; export { setup }; diff --git a/src/tabs/setup.html b/src/tabs/setup.html index c6675b29..2c24afbe 100644 --- a/src/tabs/setup.html +++ b/src/tabs/setup.html @@ -45,12 +45,12 @@
-
+
-
+