Don't show toTop or tailing buttons if there's no log

This commit is contained in:
Piotr Sarnacki 2015-03-13 13:39:14 +01:00
parent e61846a43c
commit 7897078140
2 changed files with 19 additions and 11 deletions

View File

@ -12,19 +12,22 @@
<a class="button button--grey" {{bind-attr href="view.plainTextLogUrl"}}><span class="icon icon--downloadLog"></span> Download Log</a>
</menu>
<div class="log-body">
<a href="#" id="tail" class="log-tail" {{action "toggleTailing" target=view}}>
<span class="tail-status"></span>
<span class="tail-label button button--grey"><span class="icon icon--down"></span>
{{#if view.job.isFinished}}
Scroll to End of Log
{{else}}
Follow Log
{{/if}}
</span>
</a>
{{#if view.showTailing}}
<a href="#" id="tail" class="log-tail" {{action "toggleTailing" target=view}}>
<span class="tail-status"></span>
<span class="tail-label button button--grey"><span class="icon icon--down"></span>
{{#if view.job.isFinished}}
Scroll to End of Log
{{else}}
Follow Log
{{/if}}
</span>
</a>
{{/if}}
<pre id="log" class="ansi"></pre>
{{#if view.log.hasContent}}
{{#if view.showToTop}}
<a href='#' class="to-top" {{action "toTop" target=view}}>Top</a>
{{/if}}

View File

@ -111,6 +111,11 @@ View = BasicView.extend
job.get('canRemoveLog') && @get('hasPermission')
).property('job.canRemoveLog', 'hasPermission')
showToTop: (->
@get('log.hasContent') && @get('job.canRemoveLog')
).property('log.hasContent', 'job.canRemoveLog')
showTailing: Ember.computed.alias('showToTop')
actions:
toTop: () ->
Travis.tailing.stop()