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

Commit

Permalink
chore(ngAnimate): CSS classes X-setup/X-start -> X/X-active
Browse files Browse the repository at this point in the history
BREAKING CHANGE: css classes foo-setup/foo-start become foo/foo-active

The CSS transition classes have changed suffixes. To migrate rename
.foo-setup {...} to .foo {...}
.foo-start {...} to .foo-active {...}

or for type: enter, leave, move, show, hide

.foo-type-setup {...} to .foo-type {...}
.foo-type-start {...} to .foo-type-active {...}
  • Loading branch information
matsko authored and mhevery committed May 8, 2013
1 parent 1475787 commit 11f712b
Show file tree
Hide file tree
Showing 14 changed files with 127 additions and 128 deletions.
16 changes: 8 additions & 8 deletions docs/src/templates/css/animations.css
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
.reveal-setup {
.reveal {
-webkit-transition:1s linear all;
-moz-transition:1s linear all;
-o-transition:1s linear all;
transition:1s linear all;

opacity:0;
}
.reveal-setup.reveal-start {
.reveal.reveal-active {
opacity:1;
}

Expand All @@ -15,7 +15,7 @@
overflow:hidden;
}

.slide-reveal-setup {
.slide-reveal {
-webkit-transition:0.5s linear all;
-moz-transition:0.5s linear all;
-o-transition:0.5s linear all;
Expand All @@ -26,12 +26,12 @@
opacity:0;
top:10px;
}
.slide-reveal-setup.slide-reveal-start {
.slide-reveal.slide-reveal-active {
top:0;
opacity:1;
}

.expand-enter-setup {
.expand-enter {
-webkit-transition:0.3s cubic-bezier(0.250, 0.460, 0.450, 0.940) all;
-moz-transition:0.3s cubic-bezier(0.250, 0.460, 0.450, 0.940) all;
-o-transition:0.3s cubic-bezier(0.250, 0.460, 0.450, 0.940) all;
Expand All @@ -41,13 +41,13 @@
line-height:0;
height:0!important;
}
.expand-enter-setup.expand-enter-start {
.expand-enter.expand-enter-active {
opacity:1;
line-height:20px;
height:20px!important;
}

.expand-leave-setup {
.expand-leave {
-webkit-transition:0.3s cubic-bezier(0.250, 0.460, 0.450, 0.940) all;
-moz-transition:0.3s cubic-bezier(0.250, 0.460, 0.450, 0.940) all;
-o-transition:0.3s cubic-bezier(0.250, 0.460, 0.450, 0.940) all;
Expand All @@ -56,7 +56,7 @@
opacity:1;
height:20px;
}
.expand-leave-setup.expand-leave-start {
.expand-leave.expand-leave-active {
opacity:0;
height:0;
}
Expand Down
21 changes: 10 additions & 11 deletions src/ng/animator.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
* The animate-enter CSS class is the event name that you
* have provided within the ngAnimate attribute.
* */
* .animate-enter-setup {
* .animate-enter {
* -webkit-transition: 1s linear all; /* Safari/Chrome */
* -moz-transition: 1s linear all; /* Firefox */
* -ms-transition: 1s linear all; /* IE10 */
Expand All @@ -74,7 +74,7 @@
* classes together to avoid any CSS-specificity
* conflicts
* */
* .animate-enter-setup.animate-enter-start {
* .animate-enter.animate-enter-active {
* /* The animation code itself */
* opacity: 1;
* }
Expand All @@ -87,7 +87,7 @@
*
* <pre>
* <style type="text/css">
* .animate-enter-setup {
* .animate-enter {
* -webkit-animation: enter_sequence 1s linear;
* -moz-animation: enter_sequence 1s linear;
* -o-animation: enter_sequence 1s linear;
Expand Down Expand Up @@ -116,8 +116,8 @@
*
* ngAnimate will first examine any CSS animation code and then fallback to using CSS transitions.
*
* Upon DOM mutation, the setup class is added first, then the browser is allowed to reflow the content and then,
* the start class is added to trigger the animation. The ngAnimate directive will automatically extract the duration
* Upon DOM mutation, the event class is added first, then the browser is allowed to reflow the content and then,
* the active class is added to trigger the animation. The ngAnimate directive will automatically extract the duration
* of the animation to determine when the animation ends. Once the animation is over then both CSS classes will be
* removed from the DOM. If a browser does not support CSS transitions or CSS animations then the animation will start and end
* immediately resulting in a DOM element that is at it's final state. This final state is when the DOM element
Expand Down Expand Up @@ -270,8 +270,7 @@ var $AnimatorProvider = function() {
beforeFn(element, parent, after);
afterFn(element, parent, after);
} else {
var setupClass = className + '-setup';
var startClass = className + '-start';
var activeClassName = className + '-active';

if (!parent) {
parent = after ? after.parent() : element.parent();
Expand All @@ -284,7 +283,7 @@ var $AnimatorProvider = function() {
}

element.data(NG_ANIMATE_CONTROLLER, {running:true});
element.addClass(setupClass);
element.addClass(className);
beforeFn(element, parent, after);
if (element.length == 0) return done();

Expand All @@ -304,7 +303,7 @@ var $AnimatorProvider = function() {
};

function beginAnimation() {
element.addClass(startClass);
element.addClass(activeClassName);
if (polyfillStart) {
polyfillStart(element, done, memento);
} else if (isFunction($window.getComputedStyle)) {
Expand Down Expand Up @@ -357,8 +356,8 @@ var $AnimatorProvider = function() {

function done() {
afterFn(element, parent, after);
element.removeClass(setupClass);
element.removeClass(startClass);
element.removeClass(className);
element.removeClass(activeClassName);
element.removeData(NG_ANIMATE_CONTROLLER);
}
}
Expand Down
12 changes: 6 additions & 6 deletions src/ng/directive/ngInclude.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@
<div>Content of template2.html</div>
</file>
<file name="animations.css">
.example-leave-setup,
.example-enter-setup {
.example-leave,
.example-enter {
-webkit-transition:all cubic-bezier(0.250, 0.460, 0.450, 0.940) 0.5s;
-moz-transition:all cubic-bezier(0.250, 0.460, 0.450, 0.940) 0.5s;
-ms-transition:all cubic-bezier(0.250, 0.460, 0.450, 0.940) 0.5s;
Expand All @@ -81,17 +81,17 @@
padding:10px;
}
.example-enter-setup {
.example-enter {
top:-50px;
}
.example-enter-setup.example-enter-start {
.example-enter.example-enter-active {
top:0;
}
.example-leave-setup {
.example-leave {
top:0;
}
.example-leave-setup.example-leave-start {
.example-leave.example-leave-active {
top:50px;
}
</file>
Expand Down
18 changes: 9 additions & 9 deletions src/ng/directive/ngRepeat.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,36 +88,36 @@
</div>
</file>
<file name="animations.css">
.example-repeat-enter-setup,
.example-repeat-leave-setup,
.example-repeat-move-setup {
.example-repeat-enter,
.example-repeat-leave,
.example-repeat-move {
-webkit-transition:all linear 0.5s;
-moz-transition:all linear 0.5s;
-ms-transition:all linear 0.5s;
-o-transition:all linear 0.5s;
transition:all linear 0.5s;
}
.example-repeat-enter-setup {
.example-repeat-enter {
line-height:0;
opacity:0;
}
.example-repeat-enter-setup.example-repeat-enter-start {
.example-repeat-enter.example-repeat-enter-active {
line-height:20px;
opacity:1;
}
.example-repeat-leave-setup {
.example-repeat-leave {
opacity:1;
line-height:20px;
}
.example-repeat-leave-setup.example-repeat-leave-start {
.example-repeat-leave.example-repeat-leave-active {
opacity:0;
line-height:0;
}
.example-repeat-move-setup { }
.example-repeat-move-setup.example-repeat-move-start { }
.example-repeat-move { }
.example-repeat-move.example-repeat-move-active { }
</file>
<file name="scenario.js">
it('should render initial data set', function() {
Expand Down
20 changes: 10 additions & 10 deletions src/ng/directive/ngShowHide.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,35 +45,35 @@
</div>
</file>
<file name="animations.css">
.example-show-setup, .example-hide-setup {
.example-show, .example-hide {
-webkit-transition:all linear 0.5s;
-moz-transition:all linear 0.5s;
-ms-transition:all linear 0.5s;
-o-transition:all linear 0.5s;
transition:all linear 0.5s;
}
.example-show-setup {
.example-show {
line-height:0;
opacity:0;
padding:0 10px;
}
.example-show-start.example-show-start {
.example-show-active.example-show-active {
line-height:20px;
opacity:1;
padding:10px;
border:1px solid black;
background:white;
}
.example-hide-setup {
.example-hide {
line-height:20px;
opacity:1;
padding:10px;
border:1px solid black;
background:white;
}
.example-hide-start.example-hide-start {
.example-hide-active.example-hide-active {
line-height:0;
opacity:0;
padding:0 10px;
Expand Down Expand Up @@ -154,35 +154,35 @@ var ngShowDirective = ['$animator', function($animator) {
</div>
</file>
<file name="animations.css">
.example-show-setup, .example-hide-setup {
.example-show, .example-hide {
-webkit-transition:all linear 0.5s;
-moz-transition:all linear 0.5s;
-ms-transition:all linear 0.5s;
-o-transition:all linear 0.5s;
transition:all linear 0.5s;
}
.example-show-setup {
.example-show {
line-height:0;
opacity:0;
padding:0 10px;
}
.example-show-start.example-show-start {
.example-show.example-show-active {
line-height:20px;
opacity:1;
padding:10px;
border:1px solid black;
background:white;
}
.example-hide-setup {
.example-hide {
line-height:20px;
opacity:1;
padding:10px;
border:1px solid black;
background:white;
}
.example-hide-start.example-hide-start {
.example-hide.example-hide-active {
line-height:0;
opacity:0;
padding:0 10px;
Expand Down
10 changes: 5 additions & 5 deletions src/ng/directive/ngSwitch.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
}
</file>
<file name="animations.css">
.example-leave-setup, .example-enter-setup {
.example-leave, .example-enter {
-webkit-transition:all cubic-bezier(0.250, 0.460, 0.450, 0.940) 0.5s;
-moz-transition:all cubic-bezier(0.250, 0.460, 0.450, 0.940) 0.5s;
-ms-transition:all cubic-bezier(0.250, 0.460, 0.450, 0.940) 0.5s;
Expand All @@ -90,17 +90,17 @@
padding:10px;
}
.example-enter-setup {
.example-enter {
top:-50px;
}
.example-enter-start.example-enter-start {
.example-enter.example-enter-active {
top:0;
}
.example-leave-setup {
.example-leave {
top:0;
}
.example-leave-start.example-leave-start {
.example-leave.example-leave-active {
top:50px;
}
</file>
Expand Down
10 changes: 5 additions & 5 deletions src/ng/directive/ngView.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
</file>
<file name="animations.css">
.example-leave-setup, .example-enter-setup {
.example-leave, .example-enter {
-webkit-transition:all cubic-bezier(0.250, 0.460, 0.450, 0.940) 1.5s;
-moz-transition:all cubic-bezier(0.250, 0.460, 0.450, 0.940) 1.5s;
-ms-transition:all cubic-bezier(0.250, 0.460, 0.450, 0.940) 1.5s;
Expand All @@ -87,15 +87,15 @@
padding:10px;
}
.example-enter-setup {
.example-enter {
left:100%;
}
.example-enter-setup.example-enter-start {
.example-enter.example-enter-active {
left:0;
}
.example-leave-setup { }
.example-leave-setup.example-leave-start {
.example-leave { }
.example-leave.example-leave-active {
left:-100%;
}
</file>
Expand Down
Loading

0 comments on commit 11f712b

Please sign in to comment.