Fixed A/D in pager not respecting result boundary
This commit is contained in:
parent
26d4686795
commit
248d20ede5
2 changed files with 14 additions and 2 deletions
|
@ -33,13 +33,17 @@ App.Pager = function(
|
|||
function prevPage() {
|
||||
if (pageNumber > 1) {
|
||||
setPage(pageNumber - 1);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
function nextPage() {
|
||||
if (pageNumber < totalPages) {
|
||||
setPage(pageNumber + 1);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
function setPage(newPageNumber) {
|
||||
|
|
|
@ -62,8 +62,16 @@ App.Presenters.PagerPresenter = function(
|
|||
.fail(loaded);
|
||||
|
||||
if (!endlessScroll) {
|
||||
keyboard.keydown('a', function() { syncUrl({page: pager.getPage() - 1}); });
|
||||
keyboard.keydown('d', function() { syncUrl({page: pager.getPage() + 1}); });
|
||||
keyboard.keydown('a', function() {
|
||||
if (pager.prevPage()) {
|
||||
syncUrl({page: pager.getPage()});
|
||||
}
|
||||
});
|
||||
keyboard.keydown('d', function() {
|
||||
if (pager.nextPage()) {
|
||||
syncUrl({page: pager.getPage()});
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue