mirror of
https://github.com/betaflight/betaflight-configurator.git
synced 2025-07-16 04:45:20 +03:00
Add option to reopen last tab on connect
This commit is contained in:
parent
863708ad94
commit
1488f1c6c0
6 changed files with 41 additions and 3 deletions
|
@ -321,5 +321,21 @@ GUI_control.prototype.content_ready = function (callback) {
|
|||
if (callback) callback();
|
||||
}
|
||||
|
||||
GUI_control.prototype.selectDefaultTabWhenConnected = function() {
|
||||
chrome.storage.local.get(['rememberLastTab', 'lastTab'], function (result) {
|
||||
let fallbackTab = '#tabs ul.mode-connected .tab_setup a';
|
||||
if (!(result.rememberLastTab && !!result.lastTab)) {
|
||||
$(fallbackTab).click();
|
||||
return;
|
||||
}
|
||||
let $savedTab = $("#tabs ul.mode-connected ." + result.lastTab + " a");
|
||||
if (!!$savedTab.data("ignore-reopen")) {
|
||||
$(fallbackTab).click();
|
||||
} else {
|
||||
$savedTab.click();
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
// initialize object into GUI variable
|
||||
var GUI = new GUI_control();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue