Merge pull request #3034 from haslinghuis/fix-vtx-status

Fix VTX status update after saving
10.9-maintenance
haslinghuis 2022-10-11 18:34:30 +02:00 committed by GitHub
commit 1efa12672b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 18 additions and 6 deletions

View File

@ -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"

View File

@ -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;
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);
}
}