summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Greiling <mike@pixelcog.com>2016-12-28 09:54:51 -0600
committerMike Greiling <mike@pixelcog.com>2016-12-28 09:57:40 -0600
commit682b71eae692400b08ed73c76119eb0b6a462d17 (patch)
treea367166e7f8262a4e95b34ed11aa49c8c88330b1
parentda44d84da07fbacb6f2e27dbf619860f0010f711 (diff)
downloadgitlab-ce-682b71eae692400b08ed73c76119eb0b6a462d17.tar.gz
move body click binding inside the onready callback
-rw-r--r--app/assets/javascripts/application.js16
1 files changed, 8 insertions, 8 deletions
diff --git a/app/assets/javascripts/application.js b/app/assets/javascripts/application.js
index 302f108ce17..7024691f9f7 100644
--- a/app/assets/javascripts/application.js
+++ b/app/assets/javascripts/application.js
@@ -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);
@@ -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')) {