summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorKushal Pandya <kushal@gitlab.com>2017-01-12 10:49:49 -0500
committerKushal Pandya <kushal@gitlab.com>2017-01-12 10:49:49 -0500
commitc254d05953fbf31425f934a349a65e8866ccf07a (patch)
tree5142f18a37b9c8bc7172d08aebc1a9d7dc3d818c /app
parentc69931f0f0199818689aba26519b14b6e462df83 (diff)
downloadgitlab-ce-c254d05953fbf31425f934a349a65e8866ccf07a.tar.gz
Use string constant variable for `#down-build-trace`26109-preserve-scroll-position-on-autoreload
Diffstat (limited to 'app')
-rw-r--r--app/assets/javascripts/build.js8
1 files changed, 4 insertions, 4 deletions
diff --git a/app/assets/javascripts/build.js b/app/assets/javascripts/build.js
index e6831b77d1c..fca47002870 100644
--- a/app/assets/javascripts/build.js
+++ b/app/assets/javascripts/build.js
@@ -5,7 +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';
+ var DOWN_BUILD_TRACE = '#down-build-trace';
this.Build = (function() {
Build.interval = null;
@@ -27,7 +27,7 @@
this.$autoScrollStatus = $('#autoscroll-status');
this.$autoScrollStatusText = this.$autoScrollStatus.find('.status-text');
this.$upBuildTrace = $('#up-build-trace');
- this.$downBuildTrace = $('#down-build-trace');
+ this.$downBuildTrace = $(DOWN_BUILD_TRACE);
this.$scrollTopBtn = $('#scroll-top');
this.$scrollBottomBtn = $('#scroll-bottom');
this.$buildRefreshAnimation = $('.js-build-refresh');
@@ -92,7 +92,7 @@
dataType: 'json',
success: function(buildData) {
$('.js-build-output').html(buildData.trace_html);
- if (window.location.hash.substring(1) === DOWN_BUILD_TRACE) {
+ if (window.location.hash === DOWN_BUILD_TRACE) {
$("html,body").scrollTop(this.$buildTrace.height());
}
if (removeRefreshStatuses.indexOf(buildData.status) >= 0) {
@@ -124,7 +124,7 @@
} else if (log.status !== _this.buildStatus) {
pageUrl = _this.pageUrl;
if (_this.$autoScrollStatus.data('state') === 'enabled') {
- pageUrl += '#down-build-trace';
+ pageUrl += DOWN_BUILD_TRACE;
}
return Turbolinks.visit(pageUrl);