From 2a4882f598494d0f339afcdb55d5f6d7f15d7cbf Mon Sep 17 00:00:00 2001 From: cuom1999 Date: Mon, 5 Feb 2024 15:33:58 -0600 Subject: [PATCH] Store scroll offset in cache back button --- resources/common.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/resources/common.js b/resources/common.js index 2f579a7..d30f50f 100644 --- a/resources/common.js +++ b/resources/common.js @@ -476,6 +476,7 @@ $(function() { "html": $contentClone.html(), "page": window.page, "has_next_page": window.has_next_page, + "scrollOffset": $(window).scrollTop(), })); }); if (window.performance && @@ -487,6 +488,7 @@ $(function() { content = JSON.parse(content); $('#content').html(content.html); onWindowReady(); + $(window).scrollTop(content.scrollOffset); window.page = content.page; window.has_next_page = content.has_next_page; }