Merge pull request #2302 from spracing/rework-last-tab
Allows the user to always open the last tab that was used *before* the CLI tab.10.8-maintenance
commit
de071bc136
|
@ -388,13 +388,11 @@ GuiControl.prototype.content_ready = function (callback) {
|
|||
|
||||
GuiControl.prototype.selectDefaultTabWhenConnected = function() {
|
||||
ConfigStorage.get(['rememberLastTab', 'lastTab'], function (result) {
|
||||
if (!(result.rememberLastTab
|
||||
&& !!result.lastTab
|
||||
&& result.lastTab.substring(4) !== "cli")) {
|
||||
if (result.rememberLastTab && result.lastTab) {
|
||||
$(`#tabs ul.mode-connected .${result.lastTab} a`).click();
|
||||
} else {
|
||||
$('#tabs ul.mode-connected .tab_setup a').click();
|
||||
return;
|
||||
}
|
||||
$(`#tabs ul.mode-connected .${result.lastTab} a`).click();
|
||||
});
|
||||
};
|
||||
|
||||
|
|
|
@ -219,9 +219,15 @@ function startProcess() {
|
|||
// Tabs
|
||||
$("#tabs ul.mode-connected li").click(function() {
|
||||
// store the first class of the current tab (omit things like ".active")
|
||||
ConfigStorage.set(
|
||||
{lastTab: $(this).attr("class").split(' ')[0]}
|
||||
);
|
||||
const tabName = $(this).attr("class").split(' ')[0];
|
||||
|
||||
const tabNameWithoutPrefix = tabName.substring(4);
|
||||
if (tabNameWithoutPrefix !== "cli") {
|
||||
// Don't store 'cli' otherwise you can never connect to another tab.
|
||||
ConfigStorage.set(
|
||||
{lastTab: tabName},
|
||||
);
|
||||
}
|
||||
});
|
||||
|
||||
if (GUI.isCordova()) {
|
||||
|
|
Loading…
Reference in New Issue