diff --git a/assets/scripts/app/templates/repos/show/actions.hbs b/assets/scripts/app/templates/repos/show/actions.hbs index 362c9536..72382323 100644 --- a/assets/scripts/app/templates/repos/show/actions.hbs +++ b/assets/scripts/app/templates/repos/show/actions.hbs @@ -14,14 +14,22 @@ {{/if}} {{#if view.displayRequeueBuild}}
  • - + {{#if view.requeueing}} + + {{else}} + + {{/if}}
  • {{/if}} {{#if view.displayRequeueJob}}
  • - + {{#if view.requeueing}} + + {{else}} + + {{/if}}
  • {{/if}} {{!TODO: for some reason showDownloadLog, which just delegates to jobIdForLog diff --git a/assets/scripts/app/views/repo/show.coffee b/assets/scripts/app/views/repo/show.coffee index bab9fd3b..40234e73 100644 --- a/assets/scripts/app/views/repo/show.coffee +++ b/assets/scripts/app/views/repo/show.coffee @@ -154,9 +154,6 @@ Travis.reopen tabBinding: 'controller.tab' currentUserBinding: 'controller.currentUser' - requeue: -> - @get('build').requeue() - cancelBuild: -> if @get('canCancelBuild') Travis.flash(notice: 'Build cancelation has been scheduled.') @@ -256,12 +253,20 @@ Travis.reopen @popup('code-climate') event.stopPropagation() if event? + requeueFinished: -> + @set('requeueing', false) + + requeue: (thing) -> + return if @get('requeueing') + @set('requeueing', true) + thing.requeue().then(this.requeueFinished.bind(this), this.requeueFinished.bind(this)) + requeueBuild: -> if @get('canRequeueBuild') - @get('build').requeue() + @requeue @get('build') requeueJob: -> if @get('canRequeueJob') - @get('job').requeue() + @requeue @get('job') diff --git a/assets/styles/main/tools.sass b/assets/styles/main/tools.sass index 725b21a9..e2ff5377 100644 --- a/assets/styles/main/tools.sass +++ b/assets/styles/main/tools.sass @@ -61,6 +61,19 @@ text-align: right li.icon + span.loading + display: inline-block + height: 20px + position: relative + top: 1px + cursor: pointer + color: #fef4e9 + border: solid 1px #d6d6d6 + background-color: #f4f4f4 + text-align: center + margin-left: 5px + background-position: center center + a display: inline-block width: 25px