mirror of
https://github.com/getredash/redash.git
synced 2026-03-22 19:00:09 -04:00
32 lines
913 B
JavaScript
32 lines
913 B
JavaScript
class PaginatorCtrl {
|
|
constructor() {
|
|
this.page = this.paginator.page;
|
|
}
|
|
pageChanged() {
|
|
this.paginator.setPage(this.page);
|
|
}
|
|
}
|
|
|
|
export default function init(ngModule) {
|
|
ngModule.component('paginator', {
|
|
template: `
|
|
<div class="paginator-container" ng-if="$ctrl.paginator.totalCount > $ctrl.paginator.itemsPerPage">
|
|
<ul uib-pagination total-items="$ctrl.paginator.totalCount"
|
|
items-per-page="$ctrl.paginator.itemsPerPage"
|
|
ng-model="$ctrl.page"
|
|
max-size="6"
|
|
class="pagination"
|
|
boundary-link-numbers="true"
|
|
rotate="false"
|
|
next-text='→'
|
|
previous-text='←'
|
|
ng-change="$ctrl.pageChanged()"></ul>
|
|
</div>
|
|
`,
|
|
bindings: {
|
|
paginator: '<',
|
|
},
|
|
controller: PaginatorCtrl,
|
|
});
|
|
}
|