mirror of
https://github.com/overleaf/overleaf.git
synced 2025-04-06 21:40:35 +00:00
avoid exception when elements in pdf view have been removed
This commit is contained in:
parent
ce4fb7ec04
commit
a15a6d877f
1 changed files with 5 additions and 0 deletions
|
@ -169,6 +169,11 @@ define [
|
|||
@computeOffset = (page, position) ->
|
||||
# console.log 'computing offset for', page, position
|
||||
element = page.element
|
||||
#console.log 'element =', $(element), 'parent =', $(element).parent()
|
||||
t1 = $(element).offset()?.top
|
||||
t2 = $(element).parent().offset()?.top
|
||||
if not (t1? and t2?)
|
||||
return $q((resolve, reject) -> reject('elements destroyed'))
|
||||
pageTop = $(element).offset().top - $(element).parent().offset().top
|
||||
# console.log('top of page scroll is', pageTop, 'vs', page.elemTop)
|
||||
# console.log('inner height is', $(element).innerHeight())
|
||||
|
|
Loading…
Add table
Reference in a new issue