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)
This commit is contained in:
Jason Michalski
2014-01-28 14:30:38 -05:00
parent 21c2aea755
commit bf57839e85

View File

@@ -25,15 +25,8 @@ exports.changehash = function (newhash) {
} }
$(document).trigger($.Event('hashchange.zulip')); $(document).trigger($.Event('hashchange.zulip'));
expected_hash = newhash; 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; window.location.hash = newhash;
util.reset_favicon(); util.reset_favicon();
if (newhash === "" || newhash === "#") {
viewport.scrollTop(scrolltop);
}
}; };
// Encodes an operator list into the // Encodes an operator list into the