From 3c74a744efcc5617df4fe452d889a4f77fc284c2 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Mon, 20 Apr 2015 19:12:31 +0530 Subject: [PATCH] E-book viewer: Fix a regression that caused the viewer to occasionally skip the last page in a chapter when displaying more than one pages per screen and scrolling by screen Also use a custom tag name for the blank page elements, so that there is less chance of CSS from elsewhere being applied to it --- resources/compiled_coffeescript.zip | Bin 103952 -> 103967 bytes src/calibre/ebooks/oeb/display/paged.coffee | 6 +++--- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/resources/compiled_coffeescript.zip b/resources/compiled_coffeescript.zip index c0b8d2e5b1bda00269aac2123a94ad24a25ad85f..733855099381ebe1851d312822b1381bb7eb2edf 100644 GIT binary patch delta 294 zcmbQRhHd^DwhbpY3H_Qm#VuJ(GH_=W0|N+4GfclQfl+kxhfRlBxs!4d^Rjgd64O(4 zCvV=NJy~RD-DH=q5|hn$if^8@Q{7M8H?br`FF7?cM+2m&I6fyetwdA7X0qUa(e1a` z8TWMZqL@E@@kGWb=8dw9(=Se76q$ZtG9$-ynMsUVOk9T3Cr$#2#7tr|X3U>HVG^Sc zQ(7=Y?9(JhDMrQVyptKFraMe!^qhRQpL=@h6h`amZ>KP_PcNR#=sP(#k!!l)WJagy z6Ra3{r;9@+gF!YpPhT*F(HBH;Oz)h^7^{_%oMvibn3`yrm}Zb-nwo5Gk!WCOZfR+5 VYGiC=oNQodl#*(YWRa*;3joK2YJUI# delta 328 zcmbQghHb(cwhbpY2?-VUx>@a8V!JAffdPc28K&Q#z$m);!=}TmlVu-sPd>Rr!7#H- zuQ;{Dv81FZGpV#BRYN@`u_RG9IWZ?QsVG%9r8GCUQnw&6Jyl&tLETVY)0%7Yghz6d znRcdbp0-onj|(JK9G{b#R return false create_page_div = (elem) -> - div = document.createElement('div') + div = document.createElement('blank-page-div') div.innerText = ' \n ' - div.setAttribute('data-calibre-dummy-page', '1') document.body.appendChild(div) div.style.setProperty('-webkit-column-break-before', 'always') + div.style.setProperty('display', 'block') div.style.setProperty('white-space', 'pre') div.style.setProperty('background-color', 'transparent') div.style.setProperty('background-image', 'none') @@ -455,7 +455,7 @@ class PagedDisplay if this.cols_per_screen > 1 width_left = document.body.scrollWidth - (window.pageXOffset + window.innerWidth) pages_left = width_left / this.page_width - if pages_left < this.cols_per_screen + if Math.ceil(pages_left) < this.cols_per_screen return -1 # Only blank, dummy pages left limit = document.body.scrollWidth - window.innerWidth if ans > limit