Remember sidebar position (#3231)

#fix https://github.com/FreshRSS/FreshRSS/issues/3209
Extracted from https://github.com/FreshRSS/FreshRSS/pull/3185
This commit is contained in:
Alexandre Alapetite authored and GitHub committed 2020-10-19 11:38:27 +02:00
1 parent 9ab05c7f67
commit a69a7531b6
1 file changed
+7
+7
View File
@@ -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;
}