From a196531a58f50ce49a751194aeed0a33e8fc55b2 Mon Sep 17 00:00:00 2001 From: James Allen Date: Tue, 24 May 2016 15:12:58 +0100 Subject: [PATCH] Move spinner add logic into same code pathway as spinner remove logic --- .../coffee/ide/pdfng/directives/pdfViewer.coffee | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/services/web/public/coffee/ide/pdfng/directives/pdfViewer.coffee b/services/web/public/coffee/ide/pdfng/directives/pdfViewer.coffee index 1e6a2791d2..f0ec8d61b1 100644 --- a/services/web/public/coffee/ide/pdfng/directives/pdfViewer.coffee +++ b/services/web/public/coffee/ide/pdfng/directives/pdfViewer.coffee @@ -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'