limit body click selector to tags with a hash target

This commit is contained in:
Mike Greiling 2016-12-28 11:55:22 -06:00
parent 5fe5f33d6b
commit 49d288499c

View file

@ -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);
}
});