PluginProbe
SureForms – Contact Form Builder, AI Forms, Payment Form, Survey & Quiz / 2.12.8
SureForms – Contact Form Builder, AI Forms, Payment Form, Survey & Quiz v2.12.8
2.12.8 2.12.7 2.12.6 2.12.5 2.12.4 2.12.3 2.12.2 2.12.1 2.12.0 2.11.1 2.11.0 2.10.1 2.10.0 2.9.1 2.9.0 2.8.2 2.8.1 2.7.0 2.7.1 2.8.0 trunk 0.0.10 0.0.11 0.0.12 0.0.13 All 98 releases
← All changes | assets/js/minified/blocks/multi-choice.min.js +1 -1 2.7.0 → 2.12.8 View file →
@@ -1 +1 @@
1 -function initializeMultichoice(){var e=document.querySelectorAll(".srfm-multi-choice-block");e&&e.forEach(c=>{let r=[];(()=>{var e=c.querySelector(".srfm-input-multi-choice-hidden"),i=c.querySelectorAll(".srfm-input-multi-choice-single:checked");if(e&&0!==i.length)if(c.classList.contains("srfm-radio-mode")){var l=i[0].closest(".srfm-multi-choice-single").querySelector("label");l&&(e.setAttribute("value",l.getAttribute("data-option-text")||l.innerText),e.dispatchEvent(new Event("change",{bubbles:!0})))}else if(c.classList.contains("srfm-checkbox-mode")){let t=[];i.forEach(e=>{e=e.closest(".srfm-multi-choice-single").querySelector("label");e&&t.push(e.getAttribute("data-option-text")||e.innerText)}),r=[...t];l=window.srfm.srfmUtility.prepareValue(t);e.setAttribute("value",l),e.dispatchEvent(new Event("change",{bubbles:!0}))}})();c.querySelectorAll(".srfm-multi-choice-single")?.forEach(i=>{i.addEventListener("click",e=>{var t;e.target.matches("label")||(t=i.querySelector(".srfm-input-multi-choice-single"))&&(t.click(),e.stopPropagation())})});var e=c.querySelectorAll(".srfm-input-multi-choice-single");let l;e?.forEach(e=>{e.addEventListener("click",t=>{t.stopPropagation();var i=t.target.closest(".srfm-multi-choice-single").querySelector("label"),i=(l=i?i.getAttribute("data-option-text")||i.innerText:"",c.querySelector(".srfm-input-multi-choice-hidden"));if(i&&l){let e=null;c.classList.contains("srfm-radio-mode")?t.target.checked&&(e=l):c.classList.contains("srfm-checkbox-mode")&&(r=t.target.checked?[...r,l]:r.filter(e=>e!==l),e=window.srfm.srfmUtility.prepareValue(r)),null!==e&&i.setAttribute("value",e),i.dispatchEvent(new Event("change",{bubbles:!0}))}})})})}document.addEventListener("DOMContentLoaded",initializeMultichoice);
1 +function initializeMultichoice(){var e=document.querySelectorAll(".srfm-multi-choice-block");e&&e.forEach(c=>{let r=[],n="";(()=>{var e=c.querySelector(".srfm-input-multi-choice-hidden"),i=c.querySelectorAll(".srfm-input-multi-choice-single:checked");if(e&&0!==i.length)if(c.classList.contains("srfm-radio-mode")){var l=i[0].closest(".srfm-multi-choice-single").querySelector("label");l&&(e.setAttribute("value",l.getAttribute("data-option-text")||l.innerText),e.dispatchEvent(new Event("change",{bubbles:!0})),n=e.getAttribute("value")||"")}else if(c.classList.contains("srfm-checkbox-mode")){let t=[];i.forEach(e=>{e=e.closest(".srfm-multi-choice-single").querySelector("label");e&&t.push(e.getAttribute("data-option-text")||e.innerText)}),r=[...t];l=window.srfm.srfmUtility.prepareValue(t);e.setAttribute("value",l),e.dispatchEvent(new Event("change",{bubbles:!0}))}})();c.querySelectorAll(".srfm-multi-choice-single")?.forEach(i=>{i.addEventListener("click",e=>{var t;e.target.matches("label")||(t=i.querySelector(".srfm-input-multi-choice-single"))&&(t.click(),e.stopPropagation())})});var e=c.querySelectorAll(".srfm-input-multi-choice-single");let l;e?.forEach(e=>{e.addEventListener("click",t=>{t.stopPropagation();var i=t.target.closest(".srfm-multi-choice-single").querySelector("label"),i=(l=i?i.getAttribute("data-option-text")||i.innerText:"",c.querySelector(".srfm-input-multi-choice-hidden"));if(i&&l){let e=null;c.classList.contains("srfm-radio-mode")?n=n===l?(t.target.checked=!1,e=""):e=l:c.classList.contains("srfm-checkbox-mode")&&(r=t.target.checked?[...r,l]:r.filter(e=>e!==l),e=window.srfm.srfmUtility.prepareValue(r)),null!==e&&i.setAttribute("value",e),i.dispatchEvent(new Event("change",{bubbles:!0}))}})})})}document.addEventListener("DOMContentLoaded",initializeMultichoice);