Fix remove log button popup

This commit is contained in:
Piotr Sarnacki 2015-02-24 13:51:51 +01:00 committed by Lisa Passing
parent e4a58787f4
commit 203302bd63
3 changed files with 5 additions and 11 deletions

View File

@ -1,7 +1,7 @@
<section id="log-container" class="log">
<menu class="log-header">
{{#if view.canRemoveLog}}
<button class="button button--grey" {{action "removeLogPopup" target=view}}><span class="icon icon--removeLog"></span> Remove Log</button>
<button class="button button--grey open-popup" {{action "removeLogPopup" target=view}}><span class="icon icon--removeLog"></span> Remove Log</button>
{{/if}}
<a class="button button--grey" {{bind-attr href="view.plainTextLogUrl"}}><span class="icon icon--downloadLog"></span> Download Log</a>
</menu>

View File

@ -135,10 +135,10 @@ View = BasicView.extend
Travis.flash(error: 'An error occured when removing the log')
removeLogPopup: ->
# if @get('canRemoveLog')
@set('active', true)
@popup('remove-log-popup')
return false
if @get('canRemoveLog')
@set('active', true)
@popup('remove-log-popup')
return false
noop: -> # TODO required?

View File

@ -68,12 +68,6 @@ View = BasicView.extend
@popup('code-climate')
return false
removeLogPopup: ->
if @get('canRemoveLog')
@set('active', true)
@popup('remove-log-popup')
return false
hasPermission: (->
if permissions = @get('currentUser.permissions')
permissions.contains parseInt(@get('repo.id'))