Skip to content
Snippets Groups Projects
Commit 682b71ea authored by Mike Greiling's avatar Mike Greiling
Browse files

move body click binding inside the onready callback

parent da44d84d
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -76,14 +76,6 @@
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);
Loading
Loading
@@ -97,6 +89,14 @@
// Set the default path for all cookies to GitLab's root directory
Cookies.defaults.path = gon.relative_url_root || '/';
 
// `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);
}
});
// prevent default action for disabled buttons
$('.btn').click(function(e) {
if ($(this).hasClass('disabled')) {
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment