Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/tabalinas/jsgrid
Browse files Browse the repository at this point in the history
  • Loading branch information
tabalinas committed Oct 13, 2016
2 parents a0d8a75 + 2121730 commit 318248a
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions dist/jsgrid.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
PAGE_INDEX_PLACEHOLDER = "{pageIndex}",
PAGE_COUNT_PLACEHOLDER = "{pageCount}",
ITEM_COUNT_PLACEHOLDER = "{itemCount}",
ITEM_INDEX_FROM_PLACEHOLDER = "{itemIndexFrom}",
ITEM_INDEX_TO_PLACEHOLDER = "{itemIndexTo}",

EMPTY_HREF = "javascript:void(0);";

Expand Down Expand Up @@ -821,6 +823,8 @@
var pageIndex = this.pageIndex,
pageCount = this._pagesCount(),
itemCount = this._itemsCount(),
itemIndexFrom = ((this.pageIndex - 1) * this.pageSize + 1),
itemIndexTo = Math.min((this.pageIndex * this.pageSize), itemCount),
pagerParts = this.pagerFormat.split(" ");

return $.map(pagerParts, $.proxy(function(pagerPart) {
Expand All @@ -842,6 +846,10 @@
result = pageCount;
} else if(pagerPart === ITEM_COUNT_PLACEHOLDER) {
result = itemCount;
} else if (pagerPart === ITEM_INDEX_FROM_PLACEHOLDER) {
result = itemIndexFrom;
} else if (pagerPart === ITEM_INDEX_TO_PLACEHOLDER) {
result = itemIndexTo;
}

return $.isArray(result) ? result.concat([" "]) : [result, " "];
Expand Down

0 comments on commit 318248a

Please sign in to comment.