diff options
| author | Matias Niemelä | 2013-05-07 10:29:29 -0400 |
|---|---|---|
| committer | Misko Hevery | 2013-05-08 15:40:37 -0700 |
| commit | 88c3480aff79e1ff5b1ed8bd7f1e05df8ea1e068 (patch) | |
| tree | 1eb4e66c454fdb802d080096209c111e8d22b733 /src/ng | |
| parent | 0cb04e2e9171ca60d4779cb9e0b4fe73f0926ace (diff) | |
| download | angular.js-88c3480aff79e1ff5b1ed8bd7f1e05df8ea1e068.tar.bz2 | |
feat($sniffer): Add support for supportsAnimations flag for detecting CSS Animations browser support
Diffstat (limited to 'src/ng')
| -rw-r--r-- | src/ng/animator.js | 2 | ||||
| -rw-r--r-- | src/ng/sniffer.js | 8 |
2 files changed, 7 insertions, 3 deletions
diff --git a/src/ng/animator.js b/src/ng/animator.js index a69f0784..a8064f5e 100644 --- a/src/ng/animator.js +++ b/src/ng/animator.js @@ -241,7 +241,7 @@ var $AnimatorProvider = function() { if (!parent) { parent = after ? after.parent() : element.parent(); } - if ((!$sniffer.supportsTransitions && !polyfillSetup && !polyfillStart) || + if ((!$sniffer.transitions && !polyfillSetup && !polyfillStart) || (parent.inheritedData(NG_ANIMATE_CONTROLLER) || noop).running) { beforeFn(element, parent, after); afterFn(element, parent, after); diff --git a/src/ng/sniffer.js b/src/ng/sniffer.js index 8a2fd44f..86c8dd00 100644 --- a/src/ng/sniffer.js +++ b/src/ng/sniffer.js @@ -9,7 +9,8 @@ * * @property {boolean} history Does the browser support html5 history api ? * @property {boolean} hashchange Does the browser support hashchange event ? - * @property {boolean} supportsTransitions Does the browser support CSS transition events ? + * @property {boolean} transitions Does the browser support CSS transition events ? + * @property {boolean} animations Does the browser support CSS animation events ? * * @description * This is very simple implementation of testing browser's features. @@ -23,6 +24,7 @@ function $SnifferProvider() { vendorRegex = /^(Moz|webkit|O|ms)(?=[A-Z])/, bodyStyle = document.body && document.body.style, transitions = false, + animations = false, match; if (bodyStyle) { @@ -34,6 +36,7 @@ function $SnifferProvider() { } } transitions = !!(('transition' in bodyStyle) || (vendorPrefix + 'Transition' in bodyStyle)); + animations = !!(('animation' in bodyStyle) || (vendorPrefix + 'Animation' in bodyStyle)); } @@ -61,7 +64,8 @@ function $SnifferProvider() { }, csp: document.securityPolicy ? document.securityPolicy.isActive : false, vendorPrefix: vendorPrefix, - supportsTransitions : transitions + transitions : transitions, + animations : animations }; }]; } |
