Fix Show More button
This commit is contained in:
parent
b61f79545b
commit
03ee9e3a47
|
@ -3,5 +3,3 @@ Travis.BuildsController = Em.ArrayController.extend
|
||||||
|
|
||||||
repositoryBinding: 'parent.repository'
|
repositoryBinding: 'parent.repository'
|
||||||
contentBinding: 'parent.builds'
|
contentBinding: 'parent.builds'
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -46,4 +46,4 @@ require 'travis/model'
|
||||||
@find($.extend(parameters || {}, repository_id: id, orderBy: 'number DESC'))
|
@find($.extend(parameters || {}, repository_id: id, orderBy: 'number DESC'))
|
||||||
|
|
||||||
olderThanNumber: (id, build_number) ->
|
olderThanNumber: (id, build_number) ->
|
||||||
@find(url: '/repositories/' + id + '/builds.json?bare=true&after_number=' + build_number, repository_id: id, orderBy: 'number DESC')
|
@find(url: "/builds", repository_id: id, after: build_number)
|
||||||
|
|
|
@ -39,7 +39,7 @@
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
<button {{action showMore on="click" target="builds" isVisibleBinding="hasMore"}}>
|
<button {{action showMore on="click" target="this" isVisibleBinding="hasMore"}}>
|
||||||
{{t builds.show_more}}
|
{{t builds.show_more}}
|
||||||
</button>
|
</button>
|
||||||
</p>
|
</p>
|
||||||
|
|
|
@ -3,6 +3,11 @@
|
||||||
templateName: 'builds/list'
|
templateName: 'builds/list'
|
||||||
buildsBinding: 'controller'
|
buildsBinding: 'controller'
|
||||||
|
|
||||||
|
showMore: ->
|
||||||
|
id = @get('controller.repository.id')
|
||||||
|
number = @get('controller.builds.lastObject.number')
|
||||||
|
Travis.Build.olderThanNumber(id, number)
|
||||||
|
|
||||||
BuildsItemView: Travis.View.extend
|
BuildsItemView: Travis.View.extend
|
||||||
repositoryBinding: 'controller.repository'
|
repositoryBinding: 'controller.repository'
|
||||||
buildBinding: 'context'
|
buildBinding: 'context'
|
||||||
|
|
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue
Block a user