From e1fe2ac2691e319473ed2bbca501fc6b641024e5 Mon Sep 17 00:00:00 2001 From: Matias Niemelä Date: Mon, 29 Jul 2013 19:45:59 -0400 Subject: chore(ngdocs): all animation-supported directives working with docs examples and jsFiddle/Plunkr pages --- .../angular-bootstrap/bootstrap-prettify.js | 3 +- docs/src/templates/css/animations.css | 12 ---- src/ng/directive/ngClass.js | 3 +- src/ng/directive/ngIf.js | 19 +++--- src/ng/directive/ngInclude.js | 13 +++- src/ng/directive/ngRepeat.js | 25 +++++++- src/ng/directive/ngShowHide.js | 71 +++++++--------------- src/ng/directive/ngSwitch.js | 31 ++++++---- src/ngRoute/directive/ngView.js | 15 ++++- 9 files changed, 104 insertions(+), 88 deletions(-) diff --git a/docs/components/angular-bootstrap/bootstrap-prettify.js b/docs/components/angular-bootstrap/bootstrap-prettify.js index fa40c6e7..b42c7c3a 100644 --- a/docs/components/angular-bootstrap/bootstrap-prettify.js +++ b/docs/components/angular-bootstrap/bootstrap-prettify.js @@ -7,6 +7,7 @@ var DEPENDENCIES = { 'angular.js': 'http://code.angularjs.org/' + angular.version.full + '/angular.min.js', 'angular-resource.js': 'http://code.angularjs.org/' + angular.version.full + '/angular-resource.min.js', 'angular-route.js': 'http://code.angularjs.org/' + angular.version.full + '/angular-route.min.js', + 'angular-animate.js': 'http://code.angularjs.org/' + angular.version.full + '/angular-animate.min.js', 'angular-sanitize.js': 'http://code.angularjs.org/' + angular.version.full + '/angular-sanitize.min.js', 'angular-cookies.js': 'http://code.angularjs.org/' + angular.version.full + '/angular-cookies.min.js' }; @@ -188,7 +189,7 @@ directive.ngEmbedApp = ['$templateCache', '$browser', '$rootScope', '$location', return { terminal: true, link: function(scope, element, attrs) { - var modules = [], + var modules = ['ngAnimate'], embedRootScope, deregisterEmbedRootScope; diff --git a/docs/src/templates/css/animations.css b/docs/src/templates/css/animations.css index a12ecb7b..81db50ba 100644 --- a/docs/src/templates/css/animations.css +++ b/docs/src/templates/css/animations.css @@ -64,18 +64,6 @@ height:0; } -.example-animate-container { - position:relative; - background:white; - border:1px solid black; - height:40px; - overflow:hidden; -} - -.example-animate-container > div { - padding:1em; -} - .animate-container.animations-off * { -webkit-transition: none; -moz-transition: none; diff --git a/src/ng/directive/ngClass.js b/src/ng/directive/ngClass.js index 0c4d23f0..001f67bb 100644 --- a/src/ng/directive/ngClass.js +++ b/src/ng/directive/ngClass.js @@ -109,8 +109,7 @@ function classDirective(name, selector) { Sample Text - .my-class-add, - .my-class-remove { + .my-class-add, .my-class-remove { -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; -o-transition:all cubic-bezier(0.250, 0.460, 0.450, 0.940) 0.5s; diff --git a/src/ng/directive/ngIf.js b/src/ng/directive/ngIf.js index 9d99d859..87c976a9 100755 --- a/src/ng/directive/ngIf.js +++ b/src/ng/directive/ngIf.js @@ -47,26 +47,31 @@ Click me:
Show when checked: - + I'm removed when the checkbox is unchecked.
- .example-if.ng-enter, - .example-if.ng-leave { + .animate-if { + background:white; + border:1px solid black; + padding:10px; + } + + .animate-if.ng-enter, .animate-if.ng-leave { -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; -o-transition:all cubic-bezier(0.250, 0.460, 0.450, 0.940) 0.5s; transition:all cubic-bezier(0.250, 0.460, 0.450, 0.940) 0.5s; } - .example-if.ng-enter, - .example-if.ng-leave.ng-leave-active { + .animate-if.ng-enter, + .animate-if.ng-leave.ng-leave-active { opacity:0; } - .example-if.ng-enter.ng-enter-active, - .example-if.ng-leave { + .animate-if.ng-enter.ng-enter-active, + .animate-if.ng-leave { opacity:1; } diff --git a/src/ng/directive/ngInclude.js b/src/ng/directive/ngInclude.js index 2ab9f847..0f1f245c 100644 --- a/src/ng/directive/ngInclude.js +++ b/src/ng/directive/ngInclude.js @@ -71,10 +71,21 @@ Content of template2.html
+ .example-animate-container { + position:relative; + background:white; + border:1px solid black; + height:40px; + overflow:hidden; + } + + .example-animate-container > div { + padding:10px; + } + .include-example.ng-enter, .include-example.ng-leave { -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; -o-transition:all cubic-bezier(0.250, 0.460, 0.450, 0.940) 0.5s; transition:all cubic-bezier(0.250, 0.460, 0.450, 0.940) 0.5s; diff --git a/src/ng/directive/ngRepeat.js b/src/ng/directive/ngRepeat.js index 8f12b7c2..50be2a61 100644 --- a/src/ng/directive/ngRepeat.js +++ b/src/ng/directive/ngRepeat.js @@ -127,7 +127,7 @@ ]"> I have {{friends.length}} friends. They are: -