From 568d32ec16fa5e104cf456341da383412f2c5e0c Mon Sep 17 00:00:00 2001 From: "Michael Ziminsky (Z)" Date: Thu, 26 Dec 2019 11:40:22 -0700 Subject: [PATCH] Fix goto start/end of file in flow mode --- src/pyj/read_book/flow_mode.pyj | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/pyj/read_book/flow_mode.pyj b/src/pyj/read_book/flow_mode.pyj index b50a7f7dfa..2015f4feab 100644 --- a/src/pyj/read_book/flow_mode.pyj +++ b/src/pyj/read_book/flow_mode.pyj @@ -124,8 +124,8 @@ def flow_onwheel(evt): scroll_by(dy) @check_for_scroll_end -def goto_boundary(y): - scroll_viewport.scroll_to(window.pageXOffset, 0) +def goto_boundary(dir): + scroll_viewport.scroll_to(window.pageXOffset, 0 if dir is DIRECTION.Up else document_height()) get_boss().report_human_scroll() @@ -143,10 +143,10 @@ def handle_shortcut(sc_name, evt): scroll_animator.start(DIRECTION.Up, False) return True if sc_name is 'start_of_file': - goto_boundary(-1) + goto_boundary(DIRECTION.Up) return True if sc_name is 'end_of_file': - goto_boundary(1) + goto_boundary(DIRECTION.Down) return True if sc_name is 'left': window.scrollBy(-15, 0)