aboutsummaryrefslogtreecommitdiff
path: root/p/scripts
diff options
context:
space:
mode:
authorGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2020-10-19 11:38:27 +0200
committerGravatar GitHub <noreply@github.com> 2020-10-19 11:38:27 +0200
commita69a7531b6dce98ff5d8baff4039668be11be33d (patch)
tree96fdc17149802b6ba64398e15fa43c142cee59b1 /p/scripts
parent9ab05c7f67a04409245b97c7c22a746b32e07847 (diff)
Remember sidebar position (#3231)
#fix https://github.com/FreshRSS/FreshRSS/issues/3209 Extracted from https://github.com/FreshRSS/FreshRSS/pull/3185
Diffstat (limited to 'p/scripts')
-rw-r--r--p/scripts/main.js7
1 files changed, 7 insertions, 0 deletions
diff --git a/p/scripts/main.js b/p/scripts/main.js
index ae44e9e32..6823f3119 100644
--- a/p/scripts/main.js
+++ b/p/scripts/main.js
@@ -697,6 +697,9 @@ function init_column_categories() {
return;
}
+ //Restore sidebar scroll position
+ document.getElementById('sidebar').scrollTop = +sessionStorage.getItem('FreshRSS_sidebar_scrollTop');
+
document.getElementById('aside_feed').onclick = function (ev) {
let a = ev.target.closest('.tree-folder > .tree-folder-title > a.dropdown-toggle');
if (a) {
@@ -1562,6 +1565,10 @@ function init_normal() {
faviconNbUnread();
window.onbeforeunload = function (e) {
+ const sidebar = document.getElementById('sidebar');
+ if (sidebar) { //Save sidebar scroll position
+ sessionStorage.setItem('FreshRSS_sidebar_scrollTop', sidebar.scrollTop);
+ }
if (mark_read_queue && mark_read_queue.length > 0) {
return false;
}