storm-attributelist
Advanced tools
Comparing version 0.1.0 to 0.2.0
/** | ||
* @name storm-attributelist: Batch set/toggle DOM element attributes | ||
* @version 0.1.0: Wed, 10 Feb 2016 16:55:59 GMT | ||
* @version 0.1.0: Sun, 14 Feb 2016 12:23:58 GMT | ||
* @author stormid | ||
@@ -19,3 +19,3 @@ * @license MIT | ||
return function() { | ||
if (arguments[1] === Object(arguments[1])) { | ||
if (arguments[1] === Object(arguments[1]) && !Array.isArray(arguments[1])) { | ||
for(var attr in arguments[1]){ | ||
@@ -25,4 +25,5 @@ fn.call(null, arguments[0], attr, arguments[1][attr]); | ||
} else if(Array.isArray(arguments[1])){ | ||
var el = arguments[0]; | ||
arguments[1].forEach(function(a){ | ||
fn.call(null, arguments[0], a); | ||
fn.call(null, el, a); | ||
}); | ||
@@ -34,3 +35,3 @@ } else { | ||
} | ||
return { | ||
@@ -37,0 +38,0 @@ set: function(el, attr) { |
@@ -1,1 +0,1 @@ | ||
!function(t,n){"function"==typeof define&&define.amd?define([],n):"object"==typeof exports?module.exports=n():t.StormAttributelist=n()}(this,function(){"use strict";function t(t){return function(){if(arguments[1]===Object(arguments[1]))for(var n in arguments[1])t.call(null,arguments[0],n,arguments[1][n]);else Array.isArray(arguments[1])?arguments[1].forEach(function(n){t.call(null,arguments[0],n)}):t.apply(null,arguments)}}return{set:function(n,e){t(function(t,n,e){t.setAttribute(n,e)})(n,e)},toggle:function(n,e){t(function(t,n){t.setAttribute(n,"false"===t.getAttribute(n)?!0:!1)})(n,e)}}}); | ||
!function(t,e){"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?module.exports=e():t.StormAttributelist=e()}(this,function(){"use strict";function t(t){return function(){if(arguments[1]!==Object(arguments[1])||Array.isArray(arguments[1]))if(Array.isArray(arguments[1])){var e=arguments[0];arguments[1].forEach(function(n){t.call(null,e,n)})}else t.apply(null,arguments);else for(var n in arguments[1])t.call(null,arguments[0],n,arguments[1][n])}}return{set:function(e,n){t(function(t,e,n){t.setAttribute(e,n)})(e,n)},toggle:function(e,n){t(function(t,e){t.setAttribute(e,"false"===t.getAttribute(e)?!0:!1)})(e,n)}}}); |
{ | ||
"name": "storm-attributelist", | ||
"version": "0.1.0", | ||
"version": "0.2.0", | ||
"description": "Batch set/toggle DOM element attributes", | ||
@@ -5,0 +5,0 @@ "author": "stormid", |
@@ -14,3 +14,3 @@ (function(root, factory) { | ||
return function() { | ||
if (arguments[1] === Object(arguments[1])) { | ||
if (arguments[1] === Object(arguments[1]) && !Array.isArray(arguments[1])) { | ||
for(var attr in arguments[1]){ | ||
@@ -20,4 +20,5 @@ fn.call(null, arguments[0], attr, arguments[1][attr]); | ||
} else if(Array.isArray(arguments[1])){ | ||
var el = arguments[0]; | ||
arguments[1].forEach(function(a){ | ||
fn.call(null, arguments[0], a); | ||
fn.call(null, el, a); | ||
}); | ||
@@ -29,3 +30,3 @@ } else { | ||
} | ||
return { | ||
@@ -32,0 +33,0 @@ set: function(el, attr) { |
Deprecated
MaintenanceThe maintainer of the package marked it as deprecated. This could indicate that a single version should not be used, or that the package is no longer maintained and any new vulnerabilities will not be fixed.
Found 1 instance in 1 package
7061
160
1