mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-21 09:52:06 +03:00
31 lines
816 B
JavaScript
31 lines
816 B
JavaScript
import Ember from 'ember';
|
|
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;
|