From bf57839e8584ccb224595b5a55c90e4551a7b51e Mon Sep 17 00:00:00 2001 From: Jason Michalski Date: Tue, 28 Jan 2014 14:30:38 -0500 Subject: [PATCH] Remove scrollTop workaround for hash changes Now that we are not scrolling the document we can remove the workaround to prevent browsers from scrolling on hash changes. (imported from commit 67fdaa4980d4d54d80ca9c259bbee567b8eeb917) --- static/js/hashchange.js | 7 ------- 1 file changed, 7 deletions(-) diff --git a/static/js/hashchange.js b/static/js/hashchange.js index 1f0543a1c3..7636d15c3e 100644 --- a/static/js/hashchange.js +++ b/static/js/hashchange.js @@ -25,15 +25,8 @@ exports.changehash = function (newhash) { } $(document).trigger($.Event('hashchange.zulip')); expected_hash = newhash; - // Some browsers reset scrollTop when changing the hash to "", - // so we save and restore it. - // http://stackoverflow.com/questions/4715073/window-location-hash-prevent-scrolling-to-the-top - var scrolltop = viewport.scrollTop(); window.location.hash = newhash; util.reset_favicon(); - if (newhash === "" || newhash === "#") { - viewport.scrollTop(scrolltop); - } }; // Encodes an operator list into the