Comparing version 0.0.9 to 0.0.10
@@ -1,1 +0,1 @@ | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t():"function"==typeof define&&define.amd?define(t):t()}(this,function(){"use strict";function e(e,t,n){var o=arguments.length<=3||void 0===arguments[3]?{}:arguments[3],i=o.change||"add",s=function(e){switch(i){case"add":e.classList.add(t);break;case"remove":e.classList.remove(t);break;case"toggle":e.classList.toggle(t);break;default:console.log("invalid value for change option specified")}},a=function(e){setTimeout(function(){s(e)},n)};return e.length?Array.from(e,function(e){a(e)}):a(e),this}exports.lazy=e}); | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t():"function"==typeof define&&define.amd?define(t):t()}(this,function(){"use strict";function e(e,n,o){var i=arguments.length<=3||void 0===arguments[3]?{}:arguments[3],a=i.change||"add",s=function(e){setTimeout(function(){t(e,a,n)},o)};return e.length?Array.from(e,function(e){s(e)}):s(e),this}var t=function(e,t,n){switch(t){case"add":e.classList.add(n);break;case"remove":e.classList.remove(n);break;case"toggle":e.classList.toggle(n);break;default:console.log("invalid value for change option specified")}};exports.lazy=e}); |
{ | ||
"name": "bradpitt", | ||
"version": "0.0.9", | ||
"version": "0.0.10", | ||
"description": "Set of javascript modules that do cool stuff", | ||
@@ -5,0 +5,0 @@ "main": "dist/bradpitt.min.js", |
let classSwap = (e, change, className) => { | ||
switch(change) { | ||
case 'add': | ||
e.classList.add(className) | ||
break | ||
case 'remove': | ||
e.classList.remove(className) | ||
break | ||
case 'toggle': | ||
e.classList.toggle(className) | ||
break | ||
default: | ||
console.log('invalid value for change option specified') | ||
} | ||
} | ||
/** | ||
@@ -13,19 +27,4 @@ * @param {object|...array} el dom element/s | ||
let change = options.change || 'add' | ||
let classSwap = (e) => { | ||
switch(change) { | ||
case 'add': | ||
e.classList.add(className) | ||
break | ||
case 'remove': | ||
e.classList.remove(className) | ||
break | ||
case 'toggle': | ||
e.classList.toggle(className) | ||
break | ||
default: | ||
console.log('invalid value for change option specified') | ||
} | ||
} | ||
let sT = (e) => { | ||
setTimeout(() => { classSwap(e) }, timing) | ||
setTimeout(() => { classSwap(e, change, className) }, timing) | ||
} | ||
@@ -32,0 +31,0 @@ el.length ? Array.from(el, (e) => { sT(e) }) : sT(el) |
Sorry, the diff of this file is not supported yet
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
11667