Skip to content
This repository has been archived by the owner on Dec 4, 2019. It is now read-only.

Commit

Permalink
Fix bug that unrelated builds are updated
Browse files Browse the repository at this point in the history
  • Loading branch information
r7kamura committed Jul 7, 2013
1 parent 121776a commit 100cc43
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions app/assets/javascripts/events.js.coffee
Expand Up @@ -8,14 +8,17 @@ $ ->
$('.jobs_controller.show_action').each ->
event = new Altria.ServerEvent()
event.on 'build.finished', (attributes) ->
$.ajax "/builds/#{attributes.id}", data: { type: 'list' }, success: (data) ->
$("#build#{attributes.id}").replaceWith(data)
if location.pathname == "/jobs/#{attributes.job_id}"
$.ajax "/builds/#{attributes.id}", data: { type: 'list' }, success: (data) ->
$("#build#{attributes.id}").replaceWith(data)
event.on 'build.started', (attributes) ->
$.ajax "/builds/#{attributes.id}", data: { type: 'list' }, success: (data) ->
$('.builds ul').prepend(data)
if location.pathname == "/jobs/#{attributes.job_id}"
$.ajax "/builds/#{attributes.id}", data: { type: 'list' }, success: (data) ->
$('.builds ul').prepend(data)

$('.builds_controller.show_action').each ->
new Altria.ServerEvent()
.on 'build.finished', (attributes) ->
$.ajax "/builds/#{attributes.id}", success: (data) ->
$('body').html(data)
if location.pathname == "/builds/#{attributes.id}"
$.ajax "/builds/#{attributes.id}", success: (data) ->
$('body').html(data)

0 comments on commit 100cc43

Please sign in to comment.