mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-18 16:01:40 +03:00
b4e3ac34cd
Refs #3491
30 lines
753 B
JavaScript
30 lines
753 B
JavaScript
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 || {};
|
|
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;
|