mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
Move spinner add logic into same code pathway as spinner remove logic
This commit is contained in:
parent
36ba88297b
commit
a196531a58
1 changed files with 7 additions and 6 deletions
|
@ -290,11 +290,18 @@ define [
|
|||
rescaleTimer = null
|
||||
, 0
|
||||
|
||||
spinnerTimer = null
|
||||
doRescale = (scale) ->
|
||||
# console.log 'doRescale', scale
|
||||
return unless scale?
|
||||
origposition = angular.copy scope.position
|
||||
# console.log 'origposition', origposition
|
||||
|
||||
if not spinnerTimer?
|
||||
spinnerTimer = setTimeout () ->
|
||||
spinner.add(element)
|
||||
spinnerTimer = null
|
||||
, 100
|
||||
layoutReady.promise.then (parentSize) ->
|
||||
[h, w] = parentSize
|
||||
# console.log 'in promise', h, w
|
||||
|
@ -312,7 +319,6 @@ define [
|
|||
scope.$emit 'pdf:error', error
|
||||
|
||||
elementTimer = null
|
||||
spinnerTimer = null
|
||||
updateLayout = () ->
|
||||
# if element is zero-sized keep checking until it is ready
|
||||
# console.log 'checking element ready', element.height(), element.width()
|
||||
|
@ -329,11 +335,6 @@ define [
|
|||
]
|
||||
# console.log 'resolving layoutReady with', scope.parentSize
|
||||
$timeout () ->
|
||||
if not spinnerTimer?
|
||||
spinnerTimer = setTimeout () ->
|
||||
spinner.add(element)
|
||||
spinnerTimer = null
|
||||
, 100
|
||||
layoutReady.resolve scope.parentSize
|
||||
scope.$emit 'flash-controls'
|
||||
|
||||
|
|
Loading…
Reference in a new issue