mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-21 01:41:46 +03:00
fb170d1725
closes #3222 - implementing server-side pagination for /users API - passing /users?limit=none will return all users - passing /users?status=invited will filter base on user status - creating 3 mixins (route, controller and view) to keep pagination logic DRY - updating route, controller and view for Posts to use new mixing - implementing infinite scrolling for Users Management screen (using new mixins) - Users Management screen displays all invited users, but paginates active users
24 lines
540 B
JavaScript
24 lines
540 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 || {};
|
|
settings = _.defaults(settings, defaultPaginationSettings);
|
|
|
|
this.set('paginationSettings', settings);
|
|
this.controller.set('paginationSettings', settings);
|
|
}
|
|
|
|
});
|
|
|
|
export default PaginationRoute;
|