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
path: root/app
diff options
context:
space:
mode:
authorBenedikt Huss <benedikt.huss@gmail.com>2016-05-04 21:45:12 +0300
committerBenedikt Huss <benedikt.huss@gmail.com>2016-05-05 01:18:36 +0300
commit0e9c2e721b08e244e63f1d26ac3771a8d858cd76 (patch)
tree140ce2a16bb3c391e5e97eec984e9feeaf0f75bc /app
parent655b2640ae9cbe2737369401969e99caeddf192d (diff)
Feedback from stanhu
Diffstat (limited to 'app')
-rw-r--r--app/assets/javascripts/merge_request_widget.js.coffee19
1 files changed, 8 insertions, 11 deletions
diff --git a/app/assets/javascripts/merge_request_widget.js.coffee b/app/assets/javascripts/merge_request_widget.js.coffee
index 1abda3530c4..17a5a057a94 100644
--- a/app/assets/javascripts/merge_request_widget.js.coffee
+++ b/app/assets/javascripts/merge_request_widget.js.coffee
@@ -68,20 +68,18 @@ class @MergeRequestWidget
$.getJSON @opts.ci_status_url, (data) =>
@readyForCICheck = true
- if @firstCICheck || @opts.ci_status is ''
- if @firstCICheck
- @firstCICheck = false
- @opts.ci_status = data.status
- @showCIStatus data.status
- if data.coverage
- @showCICoverage data.coverage
+ if data.status is ''
+ return
- if data.status isnt @opts.ci_status and data.status?
+ if @firstCiCheck || data.status isnt @opts.ci_status and data.status?
+ @opts.ci_status = data.status
@showCIStatus data.status
if data.coverage
@showCICoverage data.coverage
- if showNotification
+ # The first check should only update the UI, a notification
+ # should only be displayed on status changes
+ if showNotification and not @firstCiCheck
status = @ciLabelForStatus(data.status)
if status is "preparing"
@@ -104,8 +102,7 @@ class @MergeRequestWidget
@close()
Turbolinks.visit _this.opts.builds_path
)
-
- @opts.ci_status = data.status
+ @firstCiCheck = false
showCIStatus: (state) ->
$('.ci_widget').hide()