Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJared Deckard <jared.deckard@gmail.com>2016-09-20 18:50:32 +0300
committerLuke "Jared" Bennett <lbennett@gitlab.com>2016-11-04 18:07:51 +0300
commitdd45c5e11eb2b315d89779abf6103e2531e1cc08 (patch)
tree5906db681b1872a25a8e4680bba5e558b43264a9 /app/assets
parentac7efb29164e0f30e88be713c07672df3f54e3e6 (diff)
Add javascript unit tests for Build
Move comments to the correct location Remove array extension usage Move build options to fixture to match view
Diffstat (limited to 'app/assets')
-rw-r--r--app/assets/javascripts/build.js16
1 files changed, 8 insertions, 8 deletions
diff --git a/app/assets/javascripts/build.js b/app/assets/javascripts/build.js
index 54fed3dd573..3d284e5846f 100644
--- a/app/assets/javascripts/build.js
+++ b/app/assets/javascripts/build.js
@@ -37,6 +37,7 @@
this.initScrollButtonAffix();
}
if (this.buildStatus === "running" || this.buildStatus === "pending") {
+ // Bind autoscroll button to follow build output
$('#autoscroll-button').on('click', function() {
var state;
state = $(this).data("state");
@@ -47,20 +48,15 @@
$(this).data("state", "enabled");
return $(this).text("Disable autoscroll");
}
- //
- // Bind autoscroll button to follow build output
- //
});
Build.interval = setInterval((function(_this) {
+ // Check for new build output if user still watching build page
+ // Only valid for runnig build when output changes during time
return function() {
- if (window.location.href.split("#").first() === _this.pageUrl) {
+ if (_this.location() === _this.pageUrl) {
return _this.getBuildTrace();
}
};
- //
- // Check for new build output if user still watching build page
- // Only valid for runnig build when output changes during time
- //
})(this), 4000);
}
}
@@ -79,6 +75,10 @@
this.$document.off('scroll.translateSidebar').on('scroll.translateSidebar', this.translateSidebar.bind(this));
};
+ Build.prototype.location = function() {
+ return window.location.href.split("#")[0];
+ };
+
Build.prototype.getInitialBuildTrace = function() {
var removeRefreshStatuses = ['success', 'failed', 'canceled', 'skipped']