From 362f7a3eaacda5efb3e7ffddb13bb7213d1e75d7 Mon Sep 17 00:00:00 2001 From: Theodore Brown Date: Mon, 4 May 2020 11:53:36 -0600 Subject: [PATCH] Remove unnecessary function --- site/index.js | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/site/index.js b/site/index.js index 7bdf29f..58c6abf 100644 --- a/site/index.js +++ b/site/index.js @@ -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); } @@ -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); - } -}