diff --git a/public_html/js/Pager.js b/public_html/js/Pager.js index 1f0c522d..2ae4adde 100644 --- a/public_html/js/Pager.js +++ b/public_html/js/Pager.js @@ -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) { diff --git a/public_html/js/Presenters/PagerPresenter.js b/public_html/js/Presenters/PagerPresenter.js index 8c0f0f74..8475fe77 100644 --- a/public_html/js/Presenters/PagerPresenter.js +++ b/public_html/js/Presenters/PagerPresenter.js @@ -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()}); + } + }); } }