summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhil Hughes <me@iamphill.com>2016-07-06 10:16:16 +0100
committerPhil Hughes <me@iamphill.com>2016-07-06 10:16:16 +0100
commit2044af6ced27a28f87cf05ca6f2b0f7cb41031df (patch)
tree41641a41839c882ec712772e532cfb54b87c1c86
parentcfd5870b62e9d76e564ffc64db1d1281b4a363bb (diff)
downloadgitlab-ce-build-auto-refresh.tar.gz
Fixed issue with build auto-refresh not workingbuild-auto-refresh
-rw-r--r--app/assets/javascripts/ci/build.coffee8
-rw-r--r--app/views/projects/builds/show.html.haml2
2 files changed, 5 insertions, 5 deletions
diff --git a/app/assets/javascripts/ci/build.coffee b/app/assets/javascripts/ci/build.coffee
index 2d515d7efa2..74691b2c1b5 100644
--- a/app/assets/javascripts/ci/build.coffee
+++ b/app/assets/javascripts/ci/build.coffee
@@ -2,7 +2,7 @@ class @CiBuild
@interval: null
@state: null
- constructor: (@build_url, @build_status, @state) ->
+ constructor: (@page_url, @build_url, @build_status, @state) ->
clearInterval(CiBuild.interval)
# Init breakpoint checker
@@ -41,7 +41,7 @@ class @CiBuild
# Only valid for runnig build when output changes during time
#
CiBuild.interval = setInterval =>
- if window.location.href.split("#").first() is @build_url
+ if window.location.href.split("#").first() is @page_url
@getBuildTrace()
, 4000
@@ -57,7 +57,7 @@ class @CiBuild
getBuildTrace: ->
$.ajax
- url: "#{@build_url}/trace.json?state=#{encodeURIComponent(@state)}"
+ url: "#{@page_url}/trace.json?state=#{encodeURIComponent(@state)}"
dataType: "json"
success: (log) =>
if log.state
@@ -70,7 +70,7 @@ class @CiBuild
$('.js-build-output').html log.html
@checkAutoscroll()
else if log.status isnt @build_status
- Turbolinks.visit @build_url
+ Turbolinks.visit @page_url
checkAutoscroll: ->
$("html,body").scrollTop $("#build-trace").height() if "enabled" is $("#autoscroll-button").data("state")
diff --git a/app/views/projects/builds/show.html.haml b/app/views/projects/builds/show.html.haml
index d1c468c4692..4e801cc72fe 100644
--- a/app/views/projects/builds/show.html.haml
+++ b/app/views/projects/builds/show.html.haml
@@ -67,4 +67,4 @@
= render "sidebar"
:javascript
- new CiBuild("#{namespace_project_build_url(@project.namespace, @project, @build, :json)}", "#{@build.status}", "#{trace_with_state[:state]}")
+ new CiBuild("#{namespace_project_build_url(@project.namespace, @project, @build)}", "#{namespace_project_build_url(@project.namespace, @project, @build, :json)}", "#{@build.status}", "#{trace_with_state[:state]}")