mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
E-book viewer: Fix incorrect page turning when multiple pages are displayed on screen for books that wrap all their content in a single 100% height <div>. Fixes #1594657 [Private bug](https://bugs.launchpad.net/calibre/+bug/1594657)
This commit is contained in:
parent
7f76d0292f
commit
b13f5db607
Binary file not shown.
@ -140,6 +140,13 @@ class PagedDisplay
|
|||||||
first_layout = true
|
first_layout = true
|
||||||
if not single_screen and this.cols_per_screen > 1
|
if not single_screen and this.cols_per_screen > 1
|
||||||
num = this.cols_per_screen - 1
|
num = this.cols_per_screen - 1
|
||||||
|
elems = document.querySelectorAll('body > *')
|
||||||
|
if elems.length == 1
|
||||||
|
# Workaround for the case when the content is wrapped in a
|
||||||
|
# 100% height <div>. This causes the generated page divs to
|
||||||
|
# not be in the correct location. See
|
||||||
|
# https://bugs.launchpad.net/bugs/1594657 for an example.
|
||||||
|
elems[0].style.height = 'auto'
|
||||||
while num > 0
|
while num > 0
|
||||||
num -= 1
|
num -= 1
|
||||||
create_page_div()
|
create_page_div()
|
||||||
|
@ -114,6 +114,13 @@ def layout(is_single_page):
|
|||||||
first_layout = True
|
first_layout = True
|
||||||
if not single_screen and opts.cols_per_screen > 1:
|
if not single_screen and opts.cols_per_screen > 1:
|
||||||
num = opts.cols_per_screen - 1
|
num = opts.cols_per_screen - 1
|
||||||
|
elems = document.querySelectorAll('body > *')
|
||||||
|
if elems.length == 1:
|
||||||
|
# Workaround for the case when the content is wrapped in a
|
||||||
|
# 100% height <div>. This causes the generated page divs to
|
||||||
|
# not be in the correct location, at least in WebKit. See
|
||||||
|
# https://bugs.launchpad.net/bugs/1594657 for an example.
|
||||||
|
elems[0].style.height = 'auto'
|
||||||
while num > 0:
|
while num > 0:
|
||||||
num -= 1
|
num -= 1
|
||||||
create_page_div()
|
create_page_div()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user