aboutsummaryrefslogtreecommitdiffstats
path: root/src/ng/animate.js
diff options
context:
space:
mode:
authorBrian Ford2013-09-23 17:29:51 -0700
committerIgor Minar2013-09-27 12:38:27 -0700
commitc785267eb8780d8b7658ef93ebb5ebddd566294d (patch)
tree46fa85051d7aa768719b8c4572aec63ed30d52e2 /src/ng/animate.js
parent6aaae062171bfc8e5046c3eae99bc9d63037120a (diff)
downloadangular.js-c785267eb8780d8b7658ef93ebb5ebddd566294d.tar.bz2
fix(jqLite): use get/setAttribute so that jqLite works on SVG nodes
jqLite previously used `elt.className` to add and remove classes from a DOM Node, but because the className property is not writable on SVG elements, it doesn't work with them. This patch replaces accesses to `className` with `get/setAttribute`. `classList` was also considered as a solution, but because only IE10+ supports it, we have to wait. :'( The JqLiteAddClass/JQLiteRemoveClass methods are now also used directly by $animate to work around the jQuery not being able to handle class modifications on SVG elements. Closes #3858
Diffstat (limited to 'src/ng/animate.js')
-rw-r--r--src/ng/animate.js8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/ng/animate.js b/src/ng/animate.js
index fbd17848..b3fb08de 100644
--- a/src/ng/animate.js
+++ b/src/ng/animate.js
@@ -156,7 +156,9 @@ var $AnimateProvider = ['$provide', function($provide) {
className = isString(className) ?
className :
isArray(className) ? className.join(' ') : '';
- element.addClass(className);
+ forEach(element, function (element) {
+ JQLiteAddClass(element, className);
+ });
done && $timeout(done, 0, false);
},
@@ -177,7 +179,9 @@ var $AnimateProvider = ['$provide', function($provide) {
className = isString(className) ?
className :
isArray(className) ? className.join(' ') : '';
- element.removeClass(className);
+ forEach(element, function (element) {
+ JQLiteRemoveClass(element, className);
+ });
done && $timeout(done, 0, false);
},