2014-07-20 20:42:03 +04:00
|
|
|
var defaultPaginationSettings = {
|
|
|
|
page: 1,
|
|
|
|
limit: 15
|
|
|
|
};
|
|
|
|
|
|
|
|
var PaginationRoute = Ember.Mixin.create({
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Sets up pagination details
|
|
|
|
* @param {settings}: object that specifies additional pagination details
|
|
|
|
*/
|
|
|
|
setupPagination: function (settings) {
|
|
|
|
|
|
|
|
settings = settings || {};
|
2014-08-01 00:29:35 +04:00
|
|
|
for (var key in defaultPaginationSettings) {
|
|
|
|
if (!settings.hasOwnProperty(key)) {
|
|
|
|
settings[key] = defaultPaginationSettings[key];
|
|
|
|
}
|
|
|
|
}
|
2014-07-20 20:42:03 +04:00
|
|
|
|
|
|
|
this.set('paginationSettings', settings);
|
|
|
|
this.controller.set('paginationSettings', settings);
|
|
|
|
}
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
export default PaginationRoute;
|