Browse Source

Reset scroll (#2842)

Address some of https://github.com/FreshRSS/FreshRSS/issues/2836
This patch resets the scrollbar to the top when a FreshRSS page is
initialised.
Makes sure that when a FreshRSS page is restored in a Web browser
session, we do not hit the problematic situation when the content is
refreshed but the scrollbar moved back to where it was, potentially
erroneously marking as read many as read, of landing on the wrong focus.
Alexandre Alapetite 6 năm trước cách đây
mục cha
commit
8fabed337a
1 tập tin đã thay đổi với 1 bổ sung0 xóa
  1. 1 0
      p/scripts/main.js

+ 1 - 0
p/scripts/main.js

@@ -1542,6 +1542,7 @@ function init_normal() {
 }
 
 function init_beforeDOM() {
+	document.scrollingElement.scrollTop = 0;
 	if (['normal', 'reader', 'global'].indexOf(context.current_view) >= 0) {
 		init_normal();
 	}