mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
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
This commit is contained in:
parent
60af0674f4
commit
3c74a744ef
Binary file not shown.
@ -33,11 +33,11 @@ has_start_text = (elem) ->
|
||||
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
|
||||
|
Loading…
x
Reference in New Issue
Block a user