From df6cfda33fa20089650b18cf88a86613d90d18cd Mon Sep 17 00:00:00 2001 From: Biser Stoilov Date: Sat, 17 Feb 2018 20:27:42 +0200 Subject: [PATCH] Update attach-form.js --- lib/proto/attach-form.js | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/lib/proto/attach-form.js b/lib/proto/attach-form.js index 18b5a32..68201d7 100644 --- a/lib/proto/attach-form.js +++ b/lib/proto/attach-form.js @@ -50,27 +50,27 @@ var formAction = function(el, event) { // jscs:disable disallowImplicitTypeConversion if (!!element.name && element.attributes !== undefined && element.tagName.toLowerCase() !== "button") { // jscs:enable disallowImplicitTypeConversion - var elementType; - if (element.tagName.toLowerCase() === "input") { - if (element.type === "text") { - elementType = "input"; - } - if (element.type === "checkbox") { - elementType = "checkbox"; - } - if (element.type === "radio") { - elementType = "radio"; - } + var elementType + if (element.tagName.toLowerCase() === "input") { + if (element.type === "text") { + elementType = "input" } - if (element.tagName.toLowerCase() === "select") { - elementType = "select"; + if (element.type === "checkbox") { + elementType = "checkbox" } - if ((elementType !== "checkbox" && elementType !== "radio") || element.checked) { - paramObject.push({ - name: encodeURIComponent(element.name), - value: encodeURIComponent(element.value) - }) + if (element.type === "radio") { + elementType = "radio" } + } + if (element.tagName.toLowerCase() === "select") { + elementType = "select" + } + if ((elementType !== "checkbox" && elementType !== "radio") || element.checked) { + paramObject.push({ + name: encodeURIComponent(element.name), + value: encodeURIComponent(element.value) + }) + } } }