Fixed A/D in pager not respecting result boundary

This commit is contained in:
Marcin Kurczewski
2014-11-04 19:00:47 +01:00
parent 26d4686795
commit 248d20ede5
2 changed files with 14 additions and 2 deletions

View File

@ -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()});
}
});
}
}