mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-07 20:31:06 -05:00
avoid exception when switching between full and split pdf view
This commit is contained in:
parent
2840a7757f
commit
991d3c7aa1
1 changed files with 9 additions and 1 deletions
|
@ -516,7 +516,15 @@ define [
|
|||
|
||||
first = highlights[0]
|
||||
|
||||
pageNum = scope.pages[first.page].pageNum
|
||||
# switching between split and full pdf views can cause
|
||||
# highlights to appear before rendering
|
||||
if !scope.pages
|
||||
return # ignore highlight scroll if still rendering
|
||||
|
||||
pageNum = scope.pages[first.page]?.pageNum
|
||||
|
||||
if !pageNum?
|
||||
return # ignore highlight scroll if page not found
|
||||
|
||||
# use a visual offset of 72pt to match the offset in PdfController syncToCode
|
||||
scope.document.getPdfViewport(pageNum).then (viewport) ->
|
||||
|
|
Loading…
Reference in a new issue