Commit da44d84d authored by Mike Greiling's avatar Mike Greiling

catch instances where hashchange event is not fired yet we still want to adjust scroll position

parent 6892216f
......@@ -76,6 +76,14 @@
gl.utils.handleLocationHash();
}, false);
// `hashchange` is not triggered when link target is already in window.location
$('body').on('click', 'a', function() {
var href = this.getAttribute('href');
if (href.indexOf('#') === 0 && href.substr(1) === gl.utils.getLocationHash()) {
setTimeout(gl.utils.handleLocationHash, 1);
}
});
$(function () {
var $body = $('body');
var $document = $(document);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment