scrollIntoView

This commit is contained in:
Shish 2020-03-02 17:18:53 +00:00
parent 5058e1f3fd
commit 2e00b8c9ce
2 changed files with 3 additions and 1 deletions

View file

@ -41,12 +41,14 @@ function Comic(root, comicURL) {
this.prev = function() {
if(self.comicPage > 0) {
self.setPage(self.comicPage-1);
document.getElementById("comicMain").scrollIntoView();
}
};
this.next = function() {
if(self.comicPage < self.comicPages.length) {
self.setPage(self.comicPage+1);
document.getElementById("comicMain").scrollIntoView();
}
};

View file

@ -73,7 +73,7 @@ document.addEventListener('DOMContentLoaded', () => {
});
/** setup arrow key bindings **/
$(document).keyup(function(e) {
document.addEventListener("keyup", function(e) {
if ($(e.target).is('input,textarea')) { return; }
if (e.metaKey || e.ctrlKey || e.altKey || e.shiftKey) { return; }
if (e.keyCode === 37 && $("[rel='previous']").length) {