ember-cli-admin
Version:
Powerful admin dashboard for ember-cli projects, more in http://ember-admin.com
22 lines (17 loc) • 488 B
JavaScript
// Generated by CoffeeScript 1.8.0
import Ember from 'ember';
var paginationMixin;
paginationMixin = Ember.Mixin.create({
numberOfPages: Ember.computed('perPage', 'total', 'model', {
get: function() {
var total = this.get('total') || this.get('model').get('total');
return Math.ceil(total / this.get('perPage'));
}
}),
actions: {
changePerPage: function(perPage) {
return this.set('perPage', perPage);
}
}
});
export default paginationMixin;