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'
|
||||
contentBinding: 'parent.builds'
|
||||
|
||||
|
||||
|
|
|
@ -46,4 +46,4 @@ require 'travis/model'
|
|||
@find($.extend(parameters || {}, repository_id: id, orderBy: 'number DESC'))
|
||||
|
||||
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>
|
||||
|
||||
<p>
|
||||
<button {{action showMore on="click" target="builds" isVisibleBinding="hasMore"}}>
|
||||
<button {{action showMore on="click" target="this" isVisibleBinding="hasMore"}}>
|
||||
{{t builds.show_more}}
|
||||
</button>
|
||||
</p>
|
||||
|
|
|
@ -3,6 +3,11 @@
|
|||
templateName: 'builds/list'
|
||||
buildsBinding: 'controller'
|
||||
|
||||
showMore: ->
|
||||
id = @get('controller.repository.id')
|
||||
number = @get('controller.builds.lastObject.number')
|
||||
Travis.Build.olderThanNumber(id, number)
|
||||
|
||||
BuildsItemView: Travis.View.extend
|
||||
repositoryBinding: 'controller.repository'
|
||||
buildBinding: 'context'
|
||||
|
|
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue
Block a user