limit body click selector to tags with a hash target
This commit is contained in:
parent
5fe5f33d6b
commit
49d288499c
1 changed files with 2 additions and 2 deletions
|
@ -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);
|
||||
}
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue