From 73edef368454ccbbad82853501c2f355335dc0a9 Mon Sep 17 00:00:00 2001 From: Taha Jahangir Date: Wed, 20 Apr 2016 11:33:39 +0430 Subject: [PATCH] Don't catch Ctrl+PgDown/Up Ctrl+PgUp/PgDown is usually used to move between tabs, current code moves the document one page up/down while browser switching the current tab to prev/next tab. --- share/pdf2htmlEX.js.in | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/share/pdf2htmlEX.js.in b/share/pdf2htmlEX.js.in index 518eb5ec5..8804c4c1e 100644 --- a/share/pdf2htmlEX.js.in +++ b/share/pdf2htmlEX.js.in @@ -660,18 +660,20 @@ Viewer.prototype = { case 33: // Page UP: if (with_alt) { // alt-pageup -> scroll one page up self.scroll_to(self.cur_page_idx - 1); - } else { // pageup -> scroll one screen up + handled = true; + } else if (!with_ctrl) { // pageup -> scroll one screen up self.container.scrollTop -= self.container.clientHeight; + handled = true; } - handled = true; break; case 34: // Page DOWN if (with_alt) { // alt-pagedown -> scroll one page down self.scroll_to(self.cur_page_idx + 1); - } else { // pagedown -> scroll one screen down + handled = true; + } else if (!with_ctrl) { // pagedown -> scroll one screen down self.container.scrollTop += self.container.clientHeight; + handled = true; } - handled = true; break; case 35: // End self.container.scrollTop = self.container.scrollHeight;