diff options
| author | Igor Minar | 2013-11-06 15:00:46 -0800 | 
|---|---|---|
| committer | Igor Minar | 2013-11-08 01:03:17 -0800 | 
| commit | 98adc9e0383dc05efad168f30a0725cb67f5eda8 (patch) | |
| tree | 6f51110899b8fb1b1e44bc8bcc47ff3fba2e7a46 /src/ngAnimate | |
| parent | 5cfacec499e77e464a81c7ebe4b6f240da1e8748 (diff) | |
| download | angular.js-98adc9e0383dc05efad168f30a0725cb67f5eda8.tar.bz2 | |
fix($animate): don't force animations to be enabled
The way that enabling of animations was set up, made it impossible to inject a
module into the bootstrap to disable animations for things like end 2 end tests.
Now animations are temporarily blocked by setting the animation state to RUNNING
during bootstrap, which allows the developer to permanently disable at any point
by calling $animate.enabled(false).
Diffstat (limited to 'src/ngAnimate')
| -rw-r--r-- | src/ngAnimate/animate.js | 7 | 
1 files changed, 6 insertions, 1 deletions
| diff --git a/src/ngAnimate/animate.js b/src/ngAnimate/animate.js index a738987a..3b3c29b9 100644 --- a/src/ngAnimate/animate.js +++ b/src/ngAnimate/animate.js @@ -256,13 +256,18 @@ angular.module('ngAnimate', ['ng'])      var ELEMENT_NODE = 1;      var NG_ANIMATE_STATE = '$$ngAnimateState';      var NG_ANIMATE_CLASS_NAME = 'ng-animate'; -    var rootAnimateState = {disabled:true}; +    var rootAnimateState = {running: true};      $provide.decorator('$animate', ['$delegate', '$injector', '$sniffer', '$rootElement', '$timeout', '$rootScope', '$document',                              function($delegate,   $injector,   $sniffer,   $rootElement,   $timeout,   $rootScope,   $document) {        $rootElement.data(NG_ANIMATE_STATE, rootAnimateState); +      // disable animations during bootstrap, but once we bootstrapped, enable animations +      $rootScope.$$postDigest(function() { +        rootAnimateState.running = false; +      }); +        function lookup(name) {          if (name) {            var matches = [], | 
