From 34a8e6c3a23ebf282ddcf045889bb46f25d527d1 Mon Sep 17 00:00:00 2001 From: Tim Abbott Date: Tue, 16 May 2017 20:36:58 -0700 Subject: [PATCH] gear_menu: Eliminate scrollTop for non-home tabs. We should be able to eventually further clean this up to do nothing, since we now don't have tabs over than the home tab. But I'm leaving that for a future issue. --- static/js/gear_menu.js | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/static/js/gear_menu.js b/static/js/gear_menu.js index db5a5c76f2..1265c920ab 100644 --- a/static/js/gear_menu.js +++ b/static/js/gear_menu.js @@ -32,13 +32,11 @@ exports.initialize = function () { // After we show the new tab, restore its old scroll position // (we apparently have to do this after setting the hash, // because otherwise that action may scroll us somewhere.) - if (scroll_positions.hasOwnProperty(target_tab)) { - message_viewport.scrollTop(scroll_positions[target_tab]); - } else { - if (target_tab === '#home') { - navigate.scroll_to_selected(); + if (target_tab === '#home') { + if (scroll_positions.hasOwnProperty(target_tab)) { + message_viewport.scrollTop(scroll_positions[target_tab]); } else { - message_viewport.scrollTop(0); + navigate.scroll_to_selected(); } } });