From 4800dbb2fcd0ab8eb4a9b7a87926f4daa754e2ef Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Thu, 13 Feb 2014 10:57:24 +0530 Subject: [PATCH] More accurate detection of full screen layouts in paged mode --- resources/compiled_coffeescript.zip | Bin 79792 -> 79831 bytes src/calibre/ebooks/oeb/display/paged.coffee | 10 +++++----- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/resources/compiled_coffeescript.zip b/resources/compiled_coffeescript.zip index 249e8bb4905840c6cfb359a84052516c6bd16461..f1eecfc58dd9bc4cb595ae6fc2d7bd39fa6887d4 100644 GIT binary patch delta 280 zcmdn+p5^*`mJNI}`0j@Jx^OG^uJ4a#VCavYy!W%@X44tZ1vv9lD&xyDQ%W*6ORjv( zXPE@&E7&Te9A;)6_RtXW@ym3cs6)%cQraK!mMlqfFJo(^f+39 z&T7J_#aKPvz=Y9<$y*8{G0B8cit*<3wI+;5HBysJO_NfMQj(KRjMB^!lgtbZQ_a%S m%#2J^Ow5gvOie7)5=|@(ji>vYGKx>PGGgS~zT1@XD79kj#5zWAmu~~Wsqu^$Zl@ItPv+b0f9Jj+wG$lW|G&eP` zL@y~nrBW|BClkmHpS)^^26mavH+HmEp&B|p%a}2WY3b+53Nu6}|NYD{{jo8l79;<3 zJ`+X{#*pdZCX7BTDpHIL)9uU|WyAx#S=ktXfC~s;F)=V~GGt`<$5cIC(2P-J`a2WG z)f!2bCMHIy78Xe+iD`)@Nrs7LMwUhf#wjUj<|#==DJI4yX-P@uX(`(enlg$p0RT{L BOhy0z diff --git a/src/calibre/ebooks/oeb/display/paged.coffee b/src/calibre/ebooks/oeb/display/paged.coffee index 9627416f86..37fb46c9ba 100644 --- a/src/calibre/ebooks/oeb/display/paged.coffee +++ b/src/calibre/ebooks/oeb/display/paged.coffee @@ -176,12 +176,12 @@ class PagedDisplay # with height=100% overflow the first column has_svg = document.getElementsByTagName('svg').length > 0 only_img = document.getElementsByTagName('img').length == 1 and document.getElementsByTagName('div').length < 3 and document.getElementsByTagName('p').length < 2 - # We only set full_screen_layout if scrollWidth is in (clientWidth, - # 2*clientWidth) as if it is <= clientWidth scrolling will work - # anyway and if it is >= 2*clientWidth it can't be a full screen + # We only set full_screen_layout if scrollWidth is in (body_width, + # 2*body_width) as if it is <= body_width scrolling will work + # anyway and if it is >= 2*body_width it can't be a full screen # layout - log(document.body.clientWidth, document.body.scrollWidth) - this.is_full_screen_layout = (only_img or has_svg) and single_screen and document.body.scrollWidth > document.body.clientWidth + body_width = document.body.offsetWidth + 2 * sm + 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