From 49d1ea8bb2e5e95f7fa146a8a8b8bda0e88d4eee Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Fri, 20 May 2016 12:31:55 +0530 Subject: [PATCH] Dont interfere with the default forward and back shortcuts in the browser --- src/pyj/read_book/flow_mode.pyj | 2 +- src/pyj/read_book/paged_mode.pyj | 8 +++----- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/src/pyj/read_book/flow_mode.pyj b/src/pyj/read_book/flow_mode.pyj index 0a77976596..e6a26b7894 100644 --- a/src/pyj/read_book/flow_mode.pyj +++ b/src/pyj/read_book/flow_mode.pyj @@ -75,7 +75,7 @@ def flow_onkeydown(evt): goto_boundary(-1 if key is 'up' else 1) else: smooth_y_scroll(key is 'up') - elif key is 'left' or key is 'right': + elif (key is 'left' or key is 'right') and not evt.altKey: handled = True if evt.ctrlKey: window.scrollTo(0 if key is 'left' else document_width(), window.pageYOffset) diff --git a/src/pyj/read_book/paged_mode.pyj b/src/pyj/read_book/paged_mode.pyj index 05e7e49509..4c1ed32689 100644 --- a/src/pyj/read_book/paged_mode.pyj +++ b/src/pyj/read_book/paged_mode.pyj @@ -397,9 +397,9 @@ def snap_to_selection(): # selection scroll_to_xpos(left+5) -def jump_to_cfi(cfi, job_id=-1): +def jump_to_cfi(cfi): # Jump to the position indicated by the specified conformal fragment - # indicator (requires the cfi.coffee library). When in paged mode, the + # indicator. When in paged mode, the # scroll is performed so that the column containing the position # pointed to by the cfi is the left most column in the viewport cfi_scroll_to(cfi, def(x, y): @@ -407,8 +407,6 @@ def jump_to_cfi(cfi, job_id=-1): scroll_to_xpos(x) else: window.scrollTo(0, y) - # if window.py_bridge - # window.py_bridge.jump_to_cfi_finished(job_id) ) def current_cfi(): @@ -472,7 +470,7 @@ def onkeydown(evt): window.scrollTo(0 if key is 'left' else document_width(), 0) else: scroll_by_page(key is 'up', True) - elif key is 'left' or key is 'right': + elif (key is 'left' or key is 'right') and not evt.altKey: handled = True if evt.ctrlKey: window.scrollTo(0 if key is 'left' else document_width(), 0)