Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Changes and fixes to CSS Anchored Animations #11825

Closed
wants to merge 3 commits into from

Conversation

matsko
Copy link
Contributor

@matsko matsko commented May 6, 2015

No description provided.

@@ -399,10 +399,12 @@
* called `ng-animate-ref`.
*
* Let's say for example we have two views that are managed by `ng-view` and we want to show
* that there is a relationship between two components situated in different views. By using the
* that there is a relationship between two components situated in within these views. By using the
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in within --> within (?)

matsko added 3 commits May 7, 2015 11:45
BREAKING CHANGE: if your CSS code made use of the `ng-animate-anchor`
CSS class for referencing the anchored animation element then your
code must now use `ng-anchor` instead.
…re retained

This patch ensures that all of the CSS classes that exist on both
anchor nodes (the nodes that contain a `ng-animate-ref` attribute)
are not removed from the cloned element during the anchor animation.
(Previously the `in` animation would accidentally remove the CSS
classes of the first element.)

Closes angular#11681
…or` CSS class when triggering anchor animations

This fix changes anchored animations in ngAnimate to not append a series
of CSS classes with a `-suffix` prefix to the anchor element. Use
the `ng-anchor` instead CSS class instead.

BREAKING CHANGE: Prior to this fix there were to ways to apply CSS
animation code to an anchor animation. With this fix, the suffixed
CSS -anchor classes are now not used anymore for CSS anchor animations.

Instead just use the `ng-anchor` CSS class like so:

```html
<div class="container-animation" ng-if="on">
   <div ng-animate-ref="1" class="my-anchor-element"></div>
</div>

<div class="container-animation" ng-if="!on">
   <div ng-animate-ref="1" class="my-anchor-element"></div>
</div>
```

**before**:
```css
/* before (notice the container-animation CSS class) */
.container-animation-anchor {
  transition:0.5s linear all;
}
```

**now**:
```css
/* now (just use `ng-anchor` on a class that both the
   elements that contain `ng-animate-ref` share) */
.my-anchor-element.ng-anchor {
  transition:0.5s linear all;
}
```
@matsko matsko force-pushed the rename_ng_anchor branch from 142789c to 30f5c89 Compare May 7, 2015 18:45
@matsko
Copy link
Contributor Author

matsko commented May 7, 2015

LGTM (from Igor in person)

@matsko
Copy link
Contributor Author

matsko commented May 7, 2015

Landed as df24410

@matsko matsko closed this May 7, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants