diff options
author | Kushal Pandya <kushal@gitlab.com> | 2017-01-07 11:43:19 +0300 |
---|---|---|
committer | Kushal Pandya <kushal@gitlab.com> | 2017-01-12 18:31:04 +0300 |
commit | c69931f0f0199818689aba26519b14b6e462df83 (patch) | |
tree | 4fc10405c51d14ad062aa67d2143128b714edefa /app/assets | |
parent | a9e253b569d225823b0748bcf6e3855d99b53e14 (diff) |
Use better approach to access hash
Diffstat (limited to 'app/assets')
-rw-r--r-- | app/assets/javascripts/build.js | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/app/assets/javascripts/build.js b/app/assets/javascripts/build.js index 207eb639780..e6831b77d1c 100644 --- a/app/assets/javascripts/build.js +++ b/app/assets/javascripts/build.js @@ -5,6 +5,7 @@ (function() { var bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }; var AUTO_SCROLL_OFFSET = 75; + var DOWN_BUILD_TRACE = 'down-build-trace'; this.Build = (function() { Build.interval = null; @@ -83,10 +84,6 @@ return window.location.href.split("#")[0]; }; - Build.prototype.locationHash = function() { - return window.location.href.split("#")[1]; - }; - Build.prototype.getInitialBuildTrace = function() { var removeRefreshStatuses = ['success', 'failed', 'canceled', 'skipped'] @@ -95,7 +92,7 @@ dataType: 'json', success: function(buildData) { $('.js-build-output').html(buildData.trace_html); - if (this.locationHash() === 'down-build-trace') { + if (window.location.hash.substring(1) === DOWN_BUILD_TRACE) { $("html,body").scrollTop(this.$buildTrace.height()); } if (removeRefreshStatuses.indexOf(buildData.status) >= 0) { |