aboutsummaryrefslogtreecommitdiff
path: root/p/scripts/extra.js
diff options
context:
space:
mode:
authorGravatar Prashant Tholia <65695939+prashanttholia@users.noreply.github.com> 2020-11-02 16:33:16 +0530
committerGravatar GitHub <noreply@github.com> 2020-11-02 12:03:16 +0100
commit6f23999c7b3de1a69fea4dea056aed2548c4a32d (patch)
tree48b8fc12bb20159dad9fbb6f94b68f604e150b69 /p/scripts/extra.js
parentc2e3bc7caba668e34dffe7555e3406a4435c3c36 (diff)
Remember open categories (#3185)
* feature(normal) - Remember opened categories in the left menu Session storage based implementation to remember opened categories in left menu Issue Ref: #2248 * lib_phpQuery updates * Updates covering feedback points and functionality fixes * Feedback updates * Revert "lib_phpQuery updates" This reverts commit dcd23b9418405a2d14ee03c1fcadf90c04b267e1. * First review Change variable name to "remember" instead of "open". Start using localStorage instead of sessionStorage. Simplify code. * Simplify remember categories init function Replace 'session' with 'local' in function names and comment Set open categories CSS as same as when category is opened in 'active' unfold mode * Remove URLSearchParams check in remember categories init function * Delete open categories on login and logout * JSHint check fix * Second review * Make new mode the default for new users * Always open active category * Reduce / simplify code * i18n French * Revert default value Wait a bit more for this decision / change Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr>
Diffstat (limited to 'p/scripts/extra.js')
-rw-r--r--p/scripts/extra.js6
1 files changed, 6 insertions, 0 deletions
diff --git a/p/scripts/extra.js b/p/scripts/extra.js
index fe4e54739..d34042e05 100644
--- a/p/scripts/extra.js
+++ b/p/scripts/extra.js
@@ -30,6 +30,10 @@ function poormanSalt() { //If crypto.getRandomValues is not available
return text;
}
+function forgetOpenCategories() {
+ localStorage.removeItem('FreshRSS_open_categories');
+}
+
function init_crypto_form() {
/* globals dcodeIO */
const crypto_form = document.getElementById('crypto-form');
@@ -45,6 +49,8 @@ function init_crypto_form() {
return;
}
+ forgetOpenCategories();
+
crypto_form.onsubmit = function (e) {
const submit_button = this.querySelector('button[type="submit"]');
submit_button.disabled = true;