summaryrefslogtreecommitdiff
path: root/js/prefs.js
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2018-12-02 11:25:32 +0300
committerAndrew Dolgov <[email protected]>2018-12-02 11:25:32 +0300
commite23b6e397dbbbba90f9a15a6fe2d45eb862efdc5 (patch)
treea53d6bc59b069ac0a6a97b742f4f586cfdbde33e /js/prefs.js
parentaa2f119eb656cc2064da691328239010f51afb98 (diff)
prefs: store active tab for reload, remove most old table row functions
Diffstat (limited to 'js/prefs.js')
-rwxr-xr-xjs/prefs.js39
1 files changed, 27 insertions, 12 deletions
diff --git a/js/prefs.js b/js/prefs.js
index 3b9e090cc..c2ff01d47 100755
--- a/js/prefs.js
+++ b/js/prefs.js
@@ -73,18 +73,34 @@ const App = {
if (tab) {
tab = dijit.byId(tab + "Tab");
- if (tab) dijit.byId("pref-tabs").selectChild(tab);
- }
+ if (tab) {
+ dijit.byId("pref-tabs").selectChild(tab);
+
+ switch (Utils.urlParam('method')) {
+ case "editfeed":
+ window.setTimeout(function () {
+ CommonDialogs.editFeed(Utils.urlParam('methodparam'))
+ }, 100);
+ break;
+ default:
+ console.warn("initSecondStage, unknown method:", Utils.urlParam("method"));
+ }
+ }
+ } else {
+ let tab = localStorage.getItem("ttrss:prefs-tab");
- const method = Utils.urlParam('method');
+ if (tab) {
+ tab = dijit.byId(tab);
+ if (tab) {
+ dijit.byId("pref-tabs").selectChild(tab);
+ }
+ }
+ }
- if (method == 'editFeed') {
- const param = Utils.urlParam('methodparam');
+ dojo.connect(dijit.byId("pref-tabs"), "selectChild", function (elem) {
+ localStorage.setItem("ttrss:prefs-tab", elem.id);
+ });
- window.setTimeout(function () {
- CommonDialogs.editFeed(param)
- }, 100);
- }
},
hotkeyHandler: function (event) {
if (event.target.nodeName == "INPUT" || event.target.nodeName == "TEXTAREA") return;
@@ -725,8 +741,8 @@ function updateSystemList() {
});
}
-function selectTab(id, noupdate) {
- if (!noupdate) {
+function selectTab(id, selectOnly) {
+ if (!selectOnly) {
notify_progress("Loading, please wait...");
switch (id) {
@@ -754,7 +770,6 @@ function selectTab(id, noupdate) {
const tab = dijit.byId(id + "Tab");
dijit.byId("pref-tabs").selectChild(tab);
-
}
}