From fbd7f787c275813099b38239ab724bc6974ec74a Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Mon, 3 Sep 2012 11:53:40 +0530 Subject: [PATCH] E-book viewer: Make the detection of full screen layouts like covers a little more robust --- resources/compiled_coffeescript.zip | Bin 57018 -> 56964 bytes src/calibre/ebooks/oeb/display/paged.coffee | 4 ++-- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/resources/compiled_coffeescript.zip b/resources/compiled_coffeescript.zip index 9f8bccfd5e35a0494759378e0f8a291174a34875..573a8128ac70556e1a7468ad34ee82f7d3157c76 100644 GIT binary patch delta 174 zcmdnBm$_vxvqXS5Gm8iV2&{-xc1-o@Onv6Y!0^m%vRsJd=0`jS_$S|xkz+L9{9Q(p zo6&f)pvJW=8<{rpXfiU1Fk{olz#t7a4Ngo}3=x}Lc-M$Y-hJ}LMA6B+fXs6tK&HZE szI$3slBr-(|9b{Zn#U$L-cz0Y{Ei0Gzw?s??t*KUr51%}rj%qTXe$_*DyXSV<~I|a{E=Ud(P*=PfFw7I5lF02N@26F z^yV#-Rqts`zIjJ{vi=1wod9n}CJ|;41`xos5-bcQHu69mV8p~00%8TYb4+%;tHrc6 r5ybl+!acbc$YUr1@y^{fU=p}I>7J?xD;r2V8xZbiWMFuD2gCyaYEDRu diff --git a/src/calibre/ebooks/oeb/display/paged.coffee b/src/calibre/ebooks/oeb/display/paged.coffee index 4f912513a9..286945bfb6 100644 --- a/src/calibre/ebooks/oeb/display/paged.coffee +++ b/src/calibre/ebooks/oeb/display/paged.coffee @@ -79,7 +79,7 @@ class PagedDisplay if not this.in_paged_mode # Check if the current document is a full screen layout like # 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 ww = window.innerWidth @@ -149,7 +149,7 @@ class PagedDisplay # current page (when cols_per_screen == 1). Similarly img elements # 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 < 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.in_paged_mode = true