mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
E-book viewer: Make the detection of full screen layouts like covers a little more robust
This commit is contained in:
parent
e6af33d5e9
commit
fbd7f787c2
Binary file not shown.
@ -79,7 +79,7 @@ class PagedDisplay
|
|||||||
if not this.in_paged_mode
|
if not this.in_paged_mode
|
||||||
# Check if the current document is a full screen layout like
|
# Check if the current document is a full screen layout like
|
||||||
# cover, if so we treat it specially.
|
# cover, if so we treat it specially.
|
||||||
single_screen = (document.body.scrollWidth < window.innerWidth + 25 and document.body.scrollHeight < window.innerHeight + 25)
|
single_screen = (document.body.scrollHeight < window.innerHeight + 75)
|
||||||
first_layout = true
|
first_layout = true
|
||||||
|
|
||||||
ww = window.innerWidth
|
ww = window.innerWidth
|
||||||
@ -149,7 +149,7 @@ class PagedDisplay
|
|||||||
# current page (when cols_per_screen == 1). Similarly img elements
|
# current page (when cols_per_screen == 1). Similarly img elements
|
||||||
# with height=100% overflow the first column
|
# with height=100% overflow the first column
|
||||||
has_svg = document.getElementsByTagName('svg').length > 0
|
has_svg = document.getElementsByTagName('svg').length > 0
|
||||||
only_img = document.getElementsByTagName('img').length == 1 and document.getElementsByTagName('div').length < 2 and document.getElementsByTagName('p').length < 2
|
only_img = document.getElementsByTagName('img').length == 1 and document.getElementsByTagName('div').length < 3 and document.getElementsByTagName('p').length < 2
|
||||||
this.is_full_screen_layout = (only_img or has_svg) and single_screen and document.body.scrollWidth > document.body.clientWidth
|
this.is_full_screen_layout = (only_img or has_svg) and single_screen and document.body.scrollWidth > document.body.clientWidth
|
||||||
|
|
||||||
this.in_paged_mode = true
|
this.in_paged_mode = true
|
||||||
|
Loading…
x
Reference in New Issue
Block a user