element-class
Advanced tools
Comparing version 0.2.0 to 0.2.1
@@ -7,2 +7,4 @@ ## Collaborators | ||
<tr><th align="left">terinjokes</th><td><a href="https://github.com/terinjokes">GitHub/terinjokes</a></td></tr> | ||
<tr><th align="left">karissa</th><td><a href="https://github.com/karissa">GitHub/karissa</a></td></tr> | ||
</tbody></table> | ||
Error: Could not addkarissa on npm |
@@ -53,1 +53,8 @@ module.exports = function(opts) { | ||
} | ||
ElementClass.prototype.toggle = function(className) { | ||
var el = this.el | ||
if (!el) return | ||
if (this.has(className)) this.remove(className) | ||
else this.add(className) | ||
} |
@@ -9,3 +9,3 @@ { | ||
}, | ||
"version": "0.2.0", | ||
"version": "0.2.1", | ||
"bugs": { | ||
@@ -12,0 +12,0 @@ "url": "https://github.com/maxogden/element-class/issues" |
# element-class | ||
like .addClass, .removeClass and .hasClass from jquery but without dependencies | ||
like .addClass, .removeClass .toggleClass and .hasClass from jquery but without dependencies | ||
@@ -23,2 +23,5 @@ [![testling badge](https://ci.testling.com/maxogden/element-class.png)](https://ci.testling.com/maxogden/element-class) | ||
// toggle a class | ||
elementClass(foo).toggle('foo') | ||
// check if element has a class | ||
@@ -25,0 +28,0 @@ elementClass(foo).has('foo') |
@@ -14,2 +14,2 @@ var test = require('tape') | ||
t.end() | ||
}) | ||
}) |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
4020
64
33