mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
add loadedCallback to pdfng, detects when pdf is fully loaded
This commit is contained in:
parent
953821959d
commit
5e06043fcb
2 changed files with 5 additions and 1 deletions
|
@ -19,6 +19,9 @@ define [
|
|||
@navigateFn = @options.navigateFn
|
||||
@spinner = new pdfSpinner
|
||||
@resetState()
|
||||
@document.then (pdfDocument) =>
|
||||
pdfDocument.getDownloadInfo().then () =>
|
||||
@options.loadedCallback()
|
||||
|
||||
resetState: () ->
|
||||
@page = []
|
||||
|
|
|
@ -35,6 +35,8 @@ define [
|
|||
$scope.$apply()
|
||||
progressCallback: (progress) ->
|
||||
$scope.$emit 'progress', progress
|
||||
loadedCallback: () ->
|
||||
$scope.$emit 'loaded'
|
||||
})
|
||||
|
||||
# we will have all the main information needed to start display
|
||||
|
@ -51,7 +53,6 @@ define [
|
|||
]
|
||||
# console.log 'resolved q.all, page size is', result
|
||||
$scope.numPages = result.numPages
|
||||
$scope.$emit "loaded"
|
||||
|
||||
@setScale = (scale, containerHeight, containerWidth) ->
|
||||
$scope.loaded.then () ->
|
||||
|
|
Loading…
Reference in a new issue