Closed Skakruk closed 8 years ago
That plunker doesn't have animations in it, if you put them:
http://plnkr.co/edit/iTxqx6?p=preview
It fails. But there is a patch in 1.4.5 that fixes it:
http://plnkr.co/edit/Mv0uGh?p=preview
Is that good for you?
I guess, ngAnimate contains correctly working version of $animateCss, because when we link it and use done
callback - animation is working properly. Introduced in v1.4 angular contains $animateCss inside, and seems it is not working as it should.
I am confused sorry. Let's start from zero. What is the problem with your first plunker? I don't see any problem with that plunker. It doesn't have animations because ngAnimate is not loaded.
OK, I got it. There is no need to use $animate nor $animateCss for ui.bootstrap.collapse
directive. In bootstrap animations are css-driven using transitions. We just need to add/remove classes in proper time. In original bootstrap it is done with setTimeout.
E.g. ui.bootstrap.collapse
show procedure is next:
.collapse
..collapsing
, removes .collapse
. It has css transition, so there is no need to animate using js. We just start setTimeout for the same period as transition lasts (350ms)..collapsing
(to prevent any other animations related to height change), adding .collapse in
class and setting height
to auto
so prevent dynamic content to be hidden.So I think it would be better to rewrite collapse
directory to use the same approach as it is in original bootstrap, or add ngAnimate as required lib :blush:
If you want animations, you should add ngAnimate to it. I don't think there is a reason not to use it, but that is up to you.
If you say, that ngAnimate is required for animations, than there is no need to play with bs classes, just use $animateCss, see ui.bootstrap.collapse
directive in http://plnkr.co/edit/AvLTUV?p=preview
ngAnimate is optional - it gives users the choices as to whether they want the animation or not. No sense making it more restrictive unnecessarily.
Fix 3144633 has broken collapse animation, because
finally
is triggered before animation ends.http://plnkr.co/edit/pyqrBk?p=preview