Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/betaflight/betaflight-configurator.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhaslinghuis <mark@numloq.nl>2022-10-11 19:34:30 +0300
committerGitHub <noreply@github.com>2022-10-11 19:34:30 +0300
commit1efa12672bee4e31f6a8e197185cddaa4732d83c (patch)
tree5fdf0cbf9f487c497425283be8888927226f0410
parent09b98b0c1deb82203fdb5f7d11c18e1a5bd252ef (diff)
parent2a3a83e1db09d4be3b60cceb5f5f2238d2f2b494 (diff)
Merge pull request #3034 from haslinghuis/fix-vtx-status
Fix VTX status update after saving
-rw-r--r--locales/en/messages.json4
-rw-r--r--src/js/tabs/vtx.js20
2 files changed, 18 insertions, 6 deletions
diff --git a/locales/en/messages.json b/locales/en/messages.json
index cc3710eb..50f78258 100644
--- a/locales/en/messages.json
+++ b/locales/en/messages.json
@@ -6099,6 +6099,10 @@
"message": "Save",
"description": "Save button in the VTX tab"
},
+ "vtxButtonSaving": {
+ "message": "Saving",
+ "description": "Show state of the Save button in the VTX tab"
+ },
"vtxButtonSaved": {
"message": "Saved",
"description": "Saved action button in the VTX tab"
diff --git a/src/js/tabs/vtx.js b/src/js/tabs/vtx.js
index 69bd76d0..29f87ddb 100644
--- a/src/js/tabs/vtx.js
+++ b/src/js/tabs/vtx.js
@@ -885,13 +885,21 @@ vtx.initialize = function (callback) {
TABS.vtx.vtxTableSavePending = false;
- const oldText = $("#save_button").text();
- $("#save_button").html(i18n.getMessage('vtxButtonSaved'));
- setTimeout(function () {
- $("#save_button").html(oldText);
- }, 2000);
+ const saveButton = $("#save_button");
+ const oldText = saveButton.text();
+ const buttonDelay = 2000;
- TABS.vtx.initialize();
+ saveButton.html(i18n.getMessage('vtxButtonSaving')).addClass('disabled');
+
+ // Allow firmware to make relevant changes before initialization
+ setTimeout(() => {
+ saveButton.html(i18n.getMessage('vtxButtonSaved'));
+
+ setTimeout(() => {
+ TABS.vtx.initialize();
+ saveButton.html(oldText).removeClass('disabled');
+ }, buttonDelay);
+ }, buttonDelay);
}
}