aboutsummaryrefslogtreecommitdiffstats
path: root/src/jqLite.js
diff options
context:
space:
mode:
authorMisko Hevery2010-04-08 13:43:40 -0700
committerMisko Hevery2010-04-08 13:43:40 -0700
commitc4ef1f2fdd73bdaeda879e596d3d96e4e68cb6fd (patch)
tree3fc1943a4599a764aef9a41d995246bb0e48f463 /src/jqLite.js
parente0ad7dfcd47196d0aa9271e84b2c4ac26cfda3f4 (diff)
downloadangular.js-c4ef1f2fdd73bdaeda879e596d3d96e4e68cb6fd.tar.bz2
tests failing jstd to show cory
Diffstat (limited to 'src/jqLite.js')
-rw-r--r--src/jqLite.js5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/jqLite.js b/src/jqLite.js
index e9407987..6fc16e57 100644
--- a/src/jqLite.js
+++ b/src/jqLite.js
@@ -140,6 +140,11 @@ JQLite.prototype = {
this[0].className = trim((" " + this[0].className + " ").replace(/[\n\t]/g, " ").replace(" " + selector + " ", ""));
},
+ toggleClass: function(selector, condition) {
+ var self = this;
+ (condition ? self.addClass : self.removeClass).call(self, selector);
+ },
+
addClass: function( selector ) {
if (!this.hasClass(selector)) {
this[0].className = trim(this[0].className + ' ' + selector);