diff options
| author | Matias Niemelä | 2013-07-25 21:19:20 -0400 |
|---|---|---|
| committer | Misko Hevery | 2013-07-26 23:49:54 -0700 |
| commit | e31104fa6c9e5efd93ac69cd70c70cffaf200843 (patch) | |
| tree | 14c40836499eead7a065c875e4046056d4e8ed15 /src/ngAnimate | |
| parent | 15389b0e377e2a84b85178e993e4940d8098d0ed (diff) | |
| download | angular.js-e31104fa6c9e5efd93ac69cd70c70cffaf200843.tar.bz2 | |
fix($animate): make animation onComplete callbacks async
Diffstat (limited to 'src/ngAnimate')
| -rw-r--r-- | src/ngAnimate/animate.js | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/ngAnimate/animate.js b/src/ngAnimate/animate.js index 28d36629..7eef1c34 100644 --- a/src/ngAnimate/animate.js +++ b/src/ngAnimate/animate.js @@ -203,8 +203,8 @@ angular.module('ngAnimate', ['ng']) var NG_ANIMATE_STATE = '$$ngAnimateState'; var rootAnimateState = {running:true}; - $provide.decorator('$animate', ['$delegate', '$injector', '$sniffer', '$rootElement', - function($delegate, $injector, $sniffer, $rootElement) { + $provide.decorator('$animate', ['$delegate', '$injector', '$sniffer', '$rootElement', '$timeout', + function($delegate, $injector, $sniffer, $rootElement, $timeout) { var noop = angular.noop; var forEach = angular.forEach; @@ -463,7 +463,8 @@ angular.module('ngAnimate', ['ng']) if ((parent.inheritedData(NG_ANIMATE_STATE) || disabledAnimation).running) { //avoid calling done() since there is no need to remove any //data or className values since this happens earlier than that - (onComplete || noop)(); + //and also use a timeout so that it won't be asynchronous + $timeout(onComplete || noop, 0, false); return; } |
