add isBuildTab and isJobTab helpers
This commit is contained in:
parent
a6119caf3e
commit
68b9b31d7f
|
@ -11,20 +11,20 @@
|
|||
<li id="tab_branches" {{bindAttr class="view.classBranches"}}>
|
||||
<h5><a {{bindAttr href="view.urlBranches"}}>{{t repositories.tabs.branches}}</a></h5>
|
||||
</li>
|
||||
{{#with controller.build}}
|
||||
{{#if isLoaded}}
|
||||
{{#if view.isBuildTab}}
|
||||
{{#with controller.build}}
|
||||
<li id="tab_build" {{bindAttr class="view.classBuild"}}>
|
||||
<h5><a {{bindAttr href="view.urlBuild"}}>{{t repositories.tabs.build}} #{{number}}</a></h5>
|
||||
</li>
|
||||
{{/if}}
|
||||
{{/with}}
|
||||
{{#with controller.job}}
|
||||
{{#if isLoaded}}
|
||||
{{/with}}
|
||||
{{/if}}
|
||||
{{#if view.isJobTab}}
|
||||
{{#with controller.job}}
|
||||
<li id="tab_job" {{bindAttr class="view.classJob"}}>
|
||||
<h5><a {{bindAttr href="view.urlJob"}}>{{t repositories.tabs.job}} #{{number}}</a></h5>
|
||||
</li>
|
||||
{{/if}}
|
||||
{{/with}}
|
||||
{{/with}}
|
||||
{{/if}}
|
||||
</ul>
|
||||
|
||||
<div id="tools">
|
||||
|
|
|
@ -5,6 +5,15 @@
|
|||
toggleTools: ->
|
||||
$('#tools .pane').toggle()
|
||||
|
||||
isBuildTab: (->
|
||||
tab = @getPath('controller.tab')
|
||||
(tab == 'build' || tab == 'job') && @getPath('controller.build.isLoaded')
|
||||
).property('controller.tab', 'controller.build.isLoaded')
|
||||
|
||||
isJobTab: (->
|
||||
@getPath('controller.tab') == 'job' && @getPath('controller.job.isLoaded')
|
||||
).property('controller.tab', 'controller.job.isLoaded')
|
||||
|
||||
# hrm. how to parametrize bindAttr?
|
||||
classCurrent: (->
|
||||
'active' if @getPath('controller.tab') == 'current'
|
||||
|
|
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue
Block a user