ampersand-dom
Advanced tools
Comparing version 1.2.6 to 1.2.7
@@ -10,3 +10,7 @@ /*$AMPERSAND_VERSION*/ | ||
if (!cls) return; | ||
if (el.classList) { | ||
if (Array.isArray(cls)) { | ||
cls.forEach(function(c) { | ||
dom.addClass(el, c); | ||
}); | ||
} else if (el.classList) { | ||
el.classList.add(cls); | ||
@@ -24,3 +28,7 @@ } else { | ||
removeClass: function (el, cls) { | ||
if (el.classList) { | ||
if (Array.isArray(cls)) { | ||
cls.forEach(function(c) { | ||
dom.removeClass(el, c); | ||
}); | ||
} else if (el.classList) { | ||
cls = getString(cls); | ||
@@ -27,0 +35,0 @@ if (cls) el.classList.remove(cls); |
{ | ||
"name": "ampersand-dom", | ||
"description": "Super light-weight DOM manipulation lib.", | ||
"version": "1.2.6", | ||
"version": "1.2.7", | ||
"author": "'Henrik Joreteg' <henrik@andyet.net>", | ||
@@ -6,0 +6,0 @@ "bugs": { |
@@ -89,2 +89,12 @@ var suite = require('tape-suite'); | ||
dom.addClass(fixture, ['foo2', 'bar2']) | ||
t.equal(normalizeString(fixture.getAttribute('class')), 'foo bar foo2 bar2'); | ||
t.ok(dom.hasClass(fixture, 'foo2')); | ||
t.ok(dom.hasClass(fixture, 'bar2')); | ||
dom.removeClass(fixture, ['foo2', 'bar2']) | ||
t.equal(normalizeString(fixture.getAttribute('class')), 'foo bar'); | ||
t.ok(!dom.hasClass(fixture, 'foo2')); | ||
t.ok(!dom.hasClass(fixture, 'bar2')); | ||
dom.switchClass(fixture, 'bar', 'baz'); | ||
@@ -91,0 +101,0 @@ t.equal(normalizeString(fixture.getAttribute('class')), 'foo baz'); |
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
14722
304