diff options
-rw-r--r-- | app/assets/javascripts/application.js | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/app/assets/javascripts/application.js b/app/assets/javascripts/application.js index 13d5c6e1e0b..e43afbb4cc9 100644 --- a/app/assets/javascripts/application.js +++ b/app/assets/javascripts/application.js @@ -90,9 +90,9 @@ Cookies.defaults.path = gon.relative_url_root || '/'; // `hashchange` is not triggered when link target is already in window.location - $body.on('click', 'a', function() { + $body.on('click', 'a[href^="#"]', function() { var href = this.getAttribute('href'); - if (href && href.indexOf('#') === 0 && href.substr(1) === gl.utils.getLocationHash()) { + if (href.substr(1) === gl.utils.getLocationHash()) { setTimeout(gl.utils.handleLocationHash, 1); } }); |