mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Fix goto start/end of file in flow mode
This commit is contained in:
parent
b70ec30869
commit
568d32ec16
@ -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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user