From 46e704b27b236bd83d16a5bb76de7eb6dbaa70de Mon Sep 17 00:00:00 2001 From: Alexander Skvortsov Date: Sun, 9 Aug 2020 19:08:09 -0400 Subject: [PATCH] update: IndexPage (move onunload contents into onremove) --- js/src/forum/components/IndexPage.js | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/js/src/forum/components/IndexPage.js b/js/src/forum/components/IndexPage.js index e3a0037ff..70cdeef8a 100644 --- a/js/src/forum/components/IndexPage.js +++ b/js/src/forum/components/IndexPage.js @@ -44,12 +44,6 @@ export default class IndexPage extends Page { this.bodyClass = 'App--index'; } - onunload() { - // Save the scroll position so we can restore it when we return to the - // discussion list. - app.cache.scrollTop = $(window).scrollTop(); - } - view() { return (
@@ -117,6 +111,10 @@ export default class IndexPage extends Page { super.onremove(vnode); $('#app').css('min-height', ''); + + // Save the scroll position so we can restore it when we return to the + // discussion list. + app.cache.scrollTop = $(window).scrollTop(); } /**