fix selection of prerender pages in pdf viewer

This commit is contained in:
Brian Gough 2015-01-20 14:28:43 +00:00
parent f18f862be2
commit 96af4e0b4a

View file

@ -265,13 +265,13 @@ define [
lastVisiblePage = visiblePages[len-1].pageNum
lastVisiblePageIdx = lastVisiblePage - 1
# first page after
if lastVisiblePageIdx + 1 < len
if lastVisiblePageIdx + 1 < scope.pages.length
extra.push scope.pages[lastVisiblePageIdx + 1]
# page before
if firstVisiblePageIdx > 0
extra.push scope.pages[firstVisiblePageIdx - 1]
# second page after
if lastVisiblePageIdx + 2 < len
if lastVisiblePageIdx + 2 < scope.pages.length
extra.push scope.pages[lastVisiblePageIdx + 2]
return visiblePages.concat extra