From 28cefc499607680c40449970cc75a055f6477f00 Mon Sep 17 00:00:00 2001 From: Tim Abbott Date: Sat, 22 Oct 2016 22:07:09 -0700 Subject: [PATCH] hashchange: Fix buggy arguments to hashchanged causing scrolltop bug. Because jQuery passes the actual hashchange event to an onhashchange handler, the `if reload` checks in the `hashchanged` function were always returning true, resulting in the wrong logic being used for computing where to send the user in the event that they edited the hash in the browser to change their narrow. --- static/js/hashchange.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/static/js/hashchange.js b/static/js/hashchange.js index a1887a1d8b..3c91585960 100644 --- a/static/js/hashchange.js +++ b/static/js/hashchange.js @@ -181,7 +181,9 @@ function hashchanged(from_reload) { exports.initialize = function () { // jQuery doesn't have a hashchange event, so we manually wrap // our event handler - window.onhashchange = blueslip.wrap_function(hashchanged); + window.onhashchange = blueslip.wrap_function(function () { + hashchanged(false); + }); hashchanged(true); };