-
Notifications
You must be signed in to change notification settings - Fork 27.5k
feat($animate): proper support for multiple elements #5570
base: master
Are you sure you want to change the base?
feat($animate): proper support for multiple elements #5570
Conversation
@matsko , I've updated the PR. I introduced an The |
@chrisirhc great work. I will be getting to this in a few days. Sorry for the wait. |
@matsko , no problem. Just noticed that the tests didn't run due to a jshint warning and updated the PR again. |
Fixed test where IE8 was throwing |
Run performAnimation for each node instead of doing it for the first element node.
@matsko Tests are passing now, after I rebased it and used triggerReflow. |
Thank you @chrisirhc for updating this close to master. I will be reviewing this today/tomorrow. |
@chrisirhc there may be a slight API change for ngAnimate to use more properties. That means having to use multiple elements may also be put into consideration. I will reply to this thread by the end of the week to let you know what the status is on that. |
02dc2aa
to
fd2d6c0
Compare
cad9560
to
f294244
Compare
e8dc429
to
e83fab9
Compare
4dd5a20
to
998c61c
Compare
Run performAnimation for each node instead of doing it for the first
element node.
Update: Made this less hacky.
I made this PR keeping in mind to make as little changes in animate.js and as quickly as possible to get across my point. The code can be more elegant (e.g. introduce another function, etc.).By running the animation on a per-element basis, there will be no issue with comment nodes etc. and the animation methods are now more intuitive and less surprising (more explanation in #5561 for what I'm referring to).
Fixes #4954 , relates to #5561 and #4786 .
Note that this change makes the animations method behaviors asymmetric. When calling
$animate.leave(elements)
, theleave
animation to fire for each element inelements
. However, as the current implementation of animations is class-based, I don't see any value in firing theleave
animation for non-element nodes as they cannot have classes and hence, have no meaning to ngAnimate.