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.
This commit is contained in:
Tim Abbott
2017-05-16 20:36:58 -07:00
parent 72720fcf2e
commit 34a8e6c3a2

View File

@@ -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();
}
}
});