Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Add toggle to clazz api

  • Loading branch information...
commit 564147031aa2fe2e2d88b9e4c3c0398ad280f4f3 1 parent becd8cb
@bryanjswift authored
Showing with 11 additions and 1 deletion.
  1. +11 −1 js/modules/clazz.js
View
12 js/modules/clazz.js
@@ -26,10 +26,20 @@ define(function() {
}
}
+ function toggleClass(node, className) {
+ if (hasClass(node, className)) {
+ removeClass(node, className);
+ } else {
+ addClass(node, className);
+ }
+ }
+
+
var api = {
add: addClass,
has: hasClass,
- remove: removeClass
+ remove: removeClass,
+ toggle: toggleClass
};
return api;
Please sign in to comment.
Something went wrong with that request. Please try again.