show more builds button added

This commit is contained in:
oleg 2015-12-17 23:22:14 +03:00
parent cbbf1db699
commit 3b87f50f3e
3 changed files with 16 additions and 2 deletions

View File

@ -49,7 +49,7 @@ unknown revision or path not in the working tree.~~
* ~~should write at the end of build console out that build is done (or error)~~
* ~~share workspace files at static~~
* "clear workspace" button
* show more builds button (or infinity scroll) on start page
* ~~show more builds button (or infinity scroll) on start page~~
* ~~hide console output by default (when go on completed build page you scroll
down to the output which could be very long)~~
* speed up build points animation at ff (maybe borrow something from animate.css?)

View File

@ -6,3 +6,10 @@ if itemsCount
Item(build=build, key=build.id)
else
p Build history is empty
if itemsCount && itemsCount % 20 === 0
.text-center
a.btn.btn-sm.btn-default(href="javascript:void(0);", onClick=this.onShowMoreBuilds(this.props.projectName))
i.fa.fa-fw.fa-plus(title="Show more builds")
|
| Show more builds

View File

@ -5,9 +5,10 @@ define([
'reflux',
'underscore',
'./item',
'app/actions/build',
'app/stores/builds',
'templates/app/components/builds/list'
], function(React, Reflux, _, Item, buildsStore, template) {
], function(React, Reflux, _, Item, BuildActions, buildsStore, template) {
template = template.locals({
Item: Item
});
@ -25,6 +26,12 @@ define([
}
})
],
onShowMoreBuilds: function(projectName) {
BuildActions.readAll({
projectName: projectName,
limit: this.state.items.length + 20
});
},
render: template
});