mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-07 20:31:06 -05:00
fix getVisiblePages in pdf viewer to allow optimisation
This commit is contained in:
parent
debc3037ae
commit
c8012dc22c
1 changed files with 4 additions and 6 deletions
|
@ -247,14 +247,12 @@ define [
|
|||
getVisiblePages = () ->
|
||||
top = element[0].scrollTop;
|
||||
bottom = top + element[0].clientHeight;
|
||||
isVisible = (pageElement) ->
|
||||
visiblePages = scope.pages.filter (page) ->
|
||||
pageElement = page.element[0]
|
||||
pageTop = pageElement.offsetTop
|
||||
pageBottom = pageTop + pageElement.clientHeight
|
||||
return pageTop < bottom and pageBottom > top
|
||||
visiblePages = []
|
||||
for page in scope.pages
|
||||
page.visible = visible = isVisible(page.element[0])
|
||||
visiblePages.push page if visible
|
||||
page.visible = pageTop < bottom and pageBottom > top
|
||||
return page.visible
|
||||
return visiblePages
|
||||
|
||||
getExtraPages = (visiblePages) ->
|
||||
|
|
Loading…
Reference in a new issue