mirror of
https://github.com/zulip/zulip.git
synced 2025-11-06 15:03:34 +00:00
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:
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user