Skip to content

Commit

Permalink
Remove unnecessary function
Browse files Browse the repository at this point in the history
  • Loading branch information
theodorejb committed May 24, 2020
1 parent c25a5f9 commit 362f7a3
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions site/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,9 @@ function getOptionsFromInputs() {
var input = inputs[i];
var val = input.value;

if (hasClass(input, 'percent')) {
if (input.classList.contains('percent')) {
val += '%';
} else if (!hasClass(input, 'string')) {
} else if (!input.classList.contains('string')) {
val = parseFloat(val);
}

Expand Down Expand Up @@ -113,11 +113,3 @@ function getParamStringFromOpts(opts) {

return params.join('&');
}

function hasClass(el, className) {
if (el.classList) {
return el.classList.contains(className);
} else {
return new RegExp('(^| )' + className + '( |$)', 'gi').test(el.className);
}
}

0 comments on commit 362f7a3

Please sign in to comment.