mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
E-book viewer: Prevent the TAB key from causing partial scrolling in paged mode. Fixes #1571304 [page goes right when TAB is pressed](https://bugs.launchpad.net/calibre/+bug/1571304)
This commit is contained in:
parent
c82c1235e1
commit
fab4901674
Binary file not shown.
@ -249,6 +249,13 @@ class PagedDisplay
|
||||
this.is_full_screen_layout = (only_img or has_svg) and single_screen and document.body.scrollWidth > body_width and document.body.scrollWidth < 2 * body_width
|
||||
if is_single_page
|
||||
this.is_full_screen_layout = true
|
||||
# Prevent the TAB key from shifting focus as it causes partial
|
||||
# scrolling
|
||||
document.documentElement.addEventListener('keydown', (evt) ->
|
||||
if evt.keyCode == 9
|
||||
evt.preventDefault()
|
||||
)
|
||||
|
||||
|
||||
ncols = document.body.scrollWidth / this.page_width
|
||||
if ncols != Math.floor(ncols) and not this.is_full_screen_layout
|
||||
|
Loading…
x
Reference in New Issue
Block a user