diff --git a/src/pyj/read_book/flow_mode.pyj b/src/pyj/read_book/flow_mode.pyj index 586cca3979..725eb80095 100644 --- a/src/pyj/read_book/flow_mode.pyj +++ b/src/pyj/read_book/flow_mode.pyj @@ -57,7 +57,7 @@ def _check_for_scroll_end(func, obj, args, report): before = window.pageYOffset func.apply(obj, args) if window.pageYOffset is before: - get_boss().send_message('next_spine_item', previous=arguments[0] < 0) + get_boss().send_message('next_spine_item', previous=args[0] < 0) return False if report: report_human_scroll(window.pageYOffset - before) @@ -121,9 +121,9 @@ def goto_boundary(y): @check_for_scroll_end_and_report -def scroll_by_page(backward): +def scroll_by_page(direction): h = scroll_viewport.height() - 10 - window.scrollBy(0, -h if backward else h) + window.scrollBy(0, h * direction) def handle_shortcut(sc_name, evt): @@ -152,10 +152,10 @@ def handle_shortcut(sc_name, evt): get_boss().send_message('goto_doc_boundary', start=False) return True if sc_name is 'pageup': - scroll_by_page(True) + scroll_by_page(-1) return True if sc_name is 'pagedown': - scroll_by_page(False) + scroll_by_page(1) return True return False @@ -224,9 +224,9 @@ def handle_gesture(gesture): if not gesture.active and not gesture.is_held: flick_animator.start(gesture) elif gesture.type is 'prev-page': - scroll_by_page(True) + scroll_by_page(-1) elif gesture.type is 'next-page': - scroll_by_page(False) + scroll_by_page(1) elif gesture.type is 'long-tap': r = word_at_point(gesture.viewport_x, gesture.viewport_y) if r: