From f71dcb9c3c438b37e72710f1d1ae62275cf8286b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kiripolszky=20K=C3=A1roly?= Date: Sun, 22 Jul 2018 10:19:02 +0200 Subject: [PATCH] save last tab regardless of connection state --- src/js/main.js | 14 +++++++------- src/main.html | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/js/main.js b/src/js/main.js index 979724ee..b4c66ad1 100644 --- a/src/js/main.js +++ b/src/js/main.js @@ -86,19 +86,19 @@ function startProcess() { return; } + $("#tabs ul.mode-connected li").click(function() { + // store the first class of the current tab (omit things like ".active") + chrome.storage.local.set({ + lastTab: $(this).attr("class").split(' ')[0] + }); + }); + GUI.tab_switch_in_progress = true; GUI.tab_switch_cleanup(function () { // disable previously active tab highlight $('li', ui_tabs).removeClass('active'); - // store last active tab only when connected - if (GUI.connected_to) { - chrome.storage.local.set({ - lastTab: $(self).parent().attr("class") - }); - } - // Highlight selected tab $(self).parent().addClass('active'); diff --git a/src/main.html b/src/main.html index 85d235fa..2b397d3e 100755 --- a/src/main.html +++ b/src/main.html @@ -269,7 +269,7 @@