Ghost/ghost/admin/mixins/pagination-route.js
Jason Williams 0e9d4e6792 Enable JSCS checking on client.
Refs #4001
- grunt-jscs@0.8.1 which provides ES6 support.
2014-10-25 16:13:04 +00:00

30 lines
789 B
JavaScript

var defaultPaginationSettings,
PaginationRoute;
defaultPaginationSettings = {
page: 1,
limit: 15
};
PaginationRoute = Ember.Mixin.create({
/**
* Sets up pagination details
* @param {object} settings specifies additional pagination details
*/
setupPagination: function (settings) {
settings = settings || {};
for (var key in defaultPaginationSettings) {
if (defaultPaginationSettings.hasOwnProperty(key)) {
if (!settings.hasOwnProperty(key)) {
settings[key] = defaultPaginationSettings[key];
}
}
}
this.set('paginationSettings', settings);
this.controller.set('paginationSettings', settings);
}
});
export default PaginationRoute;