mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-07 20:31:06 -05:00
delay pdf spinner by 100ms
This commit is contained in:
parent
06330e6506
commit
adab8c6769
1 changed files with 6 additions and 1 deletions
|
@ -131,7 +131,9 @@ define [
|
|||
@jobs = @jobs + 1
|
||||
|
||||
element.canvas.addClass('pdfng-loading')
|
||||
spinTimer = $timeout () =>
|
||||
@spinner.add(element.canvas)
|
||||
, 100
|
||||
|
||||
completeRef = @complete
|
||||
renderTaskRef = @renderTask
|
||||
|
@ -142,6 +144,7 @@ define [
|
|||
Raven.captureMessage?('pdfng page load timed out after ' + @PAGE_LOAD_TIMEOUT + 'ms')
|
||||
# console.log 'page load timed out', pagenum
|
||||
timedOut = true
|
||||
$timeout.cancel(spinTimer)
|
||||
@spinner.stop(element.canvas)
|
||||
# @jobs = @jobs - 1
|
||||
# @triggerRenderQueue(0)
|
||||
|
@ -153,6 +156,7 @@ define [
|
|||
@pageLoad[pagenum].then (pageObject) =>
|
||||
# console.log 'in page load success', pagenum
|
||||
$timeout.cancel(timer)
|
||||
$timeout.cancel(spinTimer)
|
||||
@renderTask[pagenum] = @doRender element, pagenum, pageObject
|
||||
@renderTask[pagenum].then () =>
|
||||
# complete
|
||||
|
@ -166,6 +170,7 @@ define [
|
|||
.catch (error) ->
|
||||
# console.log 'in page load error', pagenum, 'timedOut=', timedOut
|
||||
$timeout.cancel(timer)
|
||||
$timeout.cancel(spinTimer)
|
||||
# console.log 'ERROR', error
|
||||
|
||||
doRender: (element, pagenum, page) ->
|
||||
|
|
Loading…
Reference in a new issue