1
0
Fork 0
mirror of https://github.com/portainer/portainer.git synced 2025-07-24 07:49:41 +02:00
portainer/app/services/pagination.js
2017-06-01 10:14:55 +02:00

17 lines
584 B
JavaScript

angular.module('portainer.services')
.factory('Pagination', ['LocalStorage', 'PAGINATION_MAX_ITEMS', function PaginationFactory(LocalStorage, PAGINATION_MAX_ITEMS) {
'use strict';
return {
getPaginationCount: function(key) {
var storedCount = LocalStorage.getPaginationCount(key);
var paginationCount = PAGINATION_MAX_ITEMS;
if (storedCount !== null) {
paginationCount = storedCount;
}
return '' + paginationCount;
},
setPaginationCount: function(key, count) {
LocalStorage.storePaginationCount(key, count);
}
};
}]);