Lines Matching +full:multi +full:- +full:function

2  * dirPagination - AngularJS module for paginating (almost) anything.
10 * https://groups.google.com/d/msg/angular/an9QpzqIYiM/r8v-3W1X5vcJ for the idea
11 * on how to dynamically invoke the ng-repeat directive.
15 * https://github.com/angular-ui/bootstrap/blob/master/src/pagination/pagination.js
20 (function() {
47 function dirPaginateDirective($compile, $parse, paginationService) {
55 function dirPaginationCompileFn(tElement, tAttrs) {
72 // If any value is specified for paginationId, we register the un-evaluated
73 // expression at this stage for the benefit of any dir-pagination-controls
78 return function dirPaginationLinkFn(scope, element, attrs) {
106 function() {
109 function(result) {
117 function() {
120 function(collection) {
131 // Delegate to the link function returned by the new compilation of the
132 // ng-repeat
138 // it can be properly garbage collected scope.$on('$destroy', function
154 function getRepeatExpression(expression, paginationId) {
170 * Adds the ng-repeat directive to the element. In the case of multi-element
171 * (-start, -end) it adds the appropriate multi-element ng-repeat to the first
177 function addNgRepeatToElement(element, attrs, repeatExpression) {
178 if (element[0].hasAttribute('dir-paginate-start') ||
179 element[0].hasAttribute('data-dir-paginate-start')) {
180 // using multiElement mode (dir-paginate-start, dir-paginate-end)
182 element.eq(element.length - 1).attr('ng-repeat-end', true);
189 * Adds the dir-paginate-no-compile directive to each element in the tElement
193 function addNoCompileAttributes(tElement) {
194 angular.forEach(tElement, function(el) {
196 angular.element(el).attr('dir-paginate-no-compile', true);
202 * Removes the variations on dir-paginate (data-, -start, -end) and the
203 * dir-paginate-no-compile directives.
206 function removeTemporaryAttributes(element) {
207 angular.forEach(element, function(el) {
209 angular.element(el).removeAttr('dir-paginate-no-compile');
213 .removeAttr('dir-paginate-start')
214 .removeAttr('dir-paginate')
215 .removeAttr('data-dir-paginate-start')
216 .removeAttr('data-dir-paginate');
217 element.eq(element.length - 1)
218 .removeAttr('dir-paginate-end')
219 .removeAttr('data-dir-paginate-end');
223 * Creates a getter function for the current-page attribute, using the
224 * expression provided or a default value if no current-page expression was
232 function makeCurrentPageGetterFn(scope, attrs, paginationId) {
237 // If the current-page attribute was not set, we'll make our own.
238 // Replace any non-alphanumeric characters which might confuse
252 * multi-element mode (ie dir-paginate-start, dir-paginate-end). It is
253 * dynamically added to all elements in the dir-paginate compile function, and
255 * in the link function, and all inner directives are then manually compiled.
257 function noCompileDirective() {
261 function dirPaginationControlsTemplateInstaller($templateCache) {
264-if="1 < pages.length || !autoHide"><li ng-if="boundaryLinks" ng-class="{ disabled : pagination.cu…
267 function dirPaginationControlsDirective(paginationService, paginationTemplate) {
288 DDO.templateUrl = function(elem, attrs) {
294 function dirPaginationControlsLinkFn(scope, element, attrs) {
295 // rawId is the un-interpolated value of the pagination-id attribute. This
296 // is only important when the corresponding dir-paginate directive has not
297 // yet been linked (e.g. if it is inside an ng-if block), and in that case
299 // corresponding dir-paginate directive and wrongly throwing an exception.
330 scope.$watch('maxSize', function(val) {
338 function() {
344 function(length) {
351 function() {
356 function(current, previous) {
363 function() {
368 function(currentPage, previousPage) {
374 scope.setCurrent = function(num) {
383 * Custom "track by" function which allows for duplicate "..." entries on
384 * long lists, yet fixes the problem of wrongly-highlighted links which
385 * happens when using "track by $index" - see
391 scope.tracker = function(id, index) {
395 function goToPage(num) {
415 function generatePagination() {
423 scope.pagination.last = scope.pages[scope.pages.length - 1];
433 * This function updates the values (lower, upper, total) of the
435 * display the current page range, e.g. "showing 21 - 40 of 144 results";
437 function updateRangeValues() {
443 scope.range.lower = (currentPage - 1) * itemsPerPage + 1;
448 function isValidPageNumber(num) {
456 * ng-repeat to generate the links used in pagination
464 function generatePagesArray(
473 } else if (totalPages - halfWay < currentPage) {
488 (i === paginationRange - 1 &&
510 function calculatePageNumber(i, currentPage, paginationRange, totalPages) {
517 if (totalPages - halfWay < currentPage) {
518 return totalPages - paginationRange + i;
520 return currentPage - halfWay + i;
534 * @returns {Function}
536 function itemsPerPageFilter(paginationService) {
537 return function(collection, itemsPerPage, paginationId) {
543 paginationId + ') does not match a registered pagination-id.';
553 (paginationService.getCurrentPage(paginationId) - 1) * itemsPerPage;
565 angular.forEach(keys(collection).slice(start, end), function(key) {
581 function keys(obj) {
599 function paginationService() {
603 this.registerInstance = function(instanceId) {
610 this.deregisterInstance = function(instanceId) {
614 this.isRegistered = function(instanceId) {
618 this.getLastInstanceId = function() {
622 this.setCurrentPageParser = function(instanceId, val, scope) {
626 this.setCurrentPage = function(instanceId, val) {
630 this.getCurrentPage = function(instanceId) {
635 this.setItemsPerPage = function(instanceId, val) {
638 this.getItemsPerPage = function(instanceId) {
642 this.setCollectionLength = function(instanceId, val) {
645 this.getCollectionLength = function(instanceId) {
649 this.setAsyncModeTrue = function(instanceId) {
653 this.setAsyncModeFalse = function(instanceId) {
657 this.isAsyncMode = function(instanceId) {
664 * dir-pagination-controls directive.
666 function paginationTemplateProvider() {
671 * Set a templateUrl to be used by all instances of <dir-pagination-controls>
674 this.setPath = function(path) {
680 * of <dir-pagination-controls>. If both a path *and* a string have been set,
684 this.setString = function(str) {
688 this.$get = function() {
690 getPath: function() {
693 getString: function() {