From 88c3480aff79e1ff5b1ed8bd7f1e05df8ea1e068 Mon Sep 17 00:00:00 2001 From: Matias Niemelä Date: Tue, 7 May 2013 10:29:29 -0400 Subject: feat($sniffer): Add support for supportsAnimations flag for detecting CSS Animations browser support --- src/ng/sniffer.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/ng/sniffer.js') 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 }; }]; } -- cgit v1.2.3