From 43993aaba5bed79192da0c997ca3d1223c8e8928 Mon Sep 17 00:00:00 2001 From: Michael Weimann Date: Fri, 23 Dec 2022 19:15:03 +0100 Subject: [PATCH] Fix JS code style --- resources/assets/js/forms.js | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/resources/assets/js/forms.js b/resources/assets/js/forms.js index 61ccf1db..cef40ec4 100644 --- a/resources/assets/js/forms.js +++ b/resources/assets/js/forms.js @@ -115,15 +115,23 @@ ready(() => { * {@link https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/disabled#overview} */ const DISABLE_ELEMENTS = [ - 'button', 'command', 'fieldset', 'input', 'keygen', 'optgroup', 'option', 'select', 'textarea' + 'button', + 'command', + 'fieldset', + 'input', + 'keygen', + 'optgroup', + 'option', + 'select', + 'textarea', ]; ready(() => { // get all input-radio's and add for each an onChange event listener document.querySelectorAll('input[type="radio"]').forEach((radioElement) => { // build selector and get all corrsponding elements for this input-radio - const selector = DISABLE_ELEMENTS.map((tagName) => ( - `${tagName}[data-radio-name="${radioElement.name}"][data-radio-value]` - )).join(','); + const selector = DISABLE_ELEMENTS.map( + (tagName) => `${tagName}[data-radio-name="${radioElement.name}"][data-radio-value]` + ).join(','); const elements = Array.from(document.querySelectorAll(selector)); // set all states one time on init for each of the corresponding elements