Skip to content

Commit

Permalink
Fix #520: Only display single page number when there is 1 page of res…
Browse files Browse the repository at this point in the history
…ults

Also suppress pagingTextBox in this case, since there's only one valid page
  • Loading branch information
msssk authored and Kenneth G. Franqueiro committed Jun 21, 2013
1 parent 201e4c2 commit 4379df7
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions extensions/Pagination.js
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ function(_StoreMixin, declare, lang, Deferred, on, query, string, has, put, i18n

function pageLink(page){
var link;
if(grid.pagingTextBox && page == currentPage){
if(grid.pagingTextBox && page == currentPage && end > 1){
// use a paging text box if enabled instead of just a number
link = put(linksNode, 'input.dgrid-page-input[type=text][value=$]', currentPage);
link.setAttribute("aria-label", i18n.jumpPage);
Expand Down Expand Up @@ -247,7 +247,9 @@ function(_StoreMixin, declare, lang, Deferred, on, query, string, has, put, i18n
put(linksNode, "span.dgrid-page-skip", "...");
}
// last link
pageLink(end);
if(end > 1){
pageLink(end);
}
}else if(grid.pagingTextBox){
// The pageLink function is also used to create the paging textbox.
pageLink(currentPage);
Expand Down

0 comments on commit 4379df7

Please sign in to comment.