fix getVisiblePages in pdf viewer to allow optimisation

This commit is contained in:
Brian 2015-01-20 20:35:29 +00:00
parent debc3037ae
commit c8012dc22c

View file

@ -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) ->