aboutsummaryrefslogtreecommitdiffstats
path: root/src/ng
diff options
context:
space:
mode:
authorMatias Niemelä2013-07-23 23:02:15 -0400
committerMisko Hevery2013-07-26 23:49:54 -0700
commit8ed0d5b6aa2e29ebc8d2026cb04380ed3343baef (patch)
tree2c14004d495badc36f6336a322160e9ec2c3cf5b /src/ng
parent81923f1e41560327f7de6e8fddfda0d2612658f3 (diff)
downloadangular.js-8ed0d5b6aa2e29ebc8d2026cb04380ed3343baef.tar.bz2
chore($animate): replace show/hide with addClass/removeClass
Diffstat (limited to 'src/ng')
-rw-r--r--src/ng/animate.js10
-rw-r--r--src/ng/directive/ngShowHide.js4
2 files changed, 2 insertions, 12 deletions
diff --git a/src/ng/animate.js b/src/ng/animate.js
index 7e515594..206a4b03 100644
--- a/src/ng/animate.js
+++ b/src/ng/animate.js
@@ -80,16 +80,6 @@ var $AnimateProvider = ['$provide', function($provide) {
this.enter(element, parent, after, done);
},
- show : function(element, done) {
- element.removeClass('ng-hide');
- (done || noop)();
- },
-
- hide : function(element, done) {
- element.addClass('ng-hide');
- (done || noop)();
- },
-
addClass : function(element, className, done) {
className = isString(className) ?
className :
diff --git a/src/ng/directive/ngShowHide.js b/src/ng/directive/ngShowHide.js
index bdbcf463..1bba11ef 100644
--- a/src/ng/directive/ngShowHide.js
+++ b/src/ng/directive/ngShowHide.js
@@ -100,7 +100,7 @@
var ngShowDirective = ['$animate', function($animate) {
return function(scope, element, attr) {
scope.$watch(attr.ngShow, function ngShowWatchAction(value){
- $animate[toBoolean(value) ? 'show' : 'hide'](element);
+ $animate[toBoolean(value) ? 'removeClass' : 'addClass'](element, 'ng-hide');
});
};
}];
@@ -204,7 +204,7 @@ var ngShowDirective = ['$animate', function($animate) {
var ngHideDirective = ['$animate', function($animate) {
return function(scope, element, attr) {
scope.$watch(attr.ngHide, function ngHideWatchAction(value){
- $animate[toBoolean(value) ? 'hide' : 'show'](element);
+ $animate[toBoolean(value) ? 'addClass' : 'removeClass'](element, 'ng-hide');
});
};
}];