Fix JS code style
This commit is contained in:
parent
2bab370221
commit
43993aaba5
|
@ -115,15 +115,23 @@ ready(() => {
|
||||||
* {@link https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/disabled#overview}
|
* {@link https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/disabled#overview}
|
||||||
*/
|
*/
|
||||||
const DISABLE_ELEMENTS = [
|
const DISABLE_ELEMENTS = [
|
||||||
'button', 'command', 'fieldset', 'input', 'keygen', 'optgroup', 'option', 'select', 'textarea'
|
'button',
|
||||||
|
'command',
|
||||||
|
'fieldset',
|
||||||
|
'input',
|
||||||
|
'keygen',
|
||||||
|
'optgroup',
|
||||||
|
'option',
|
||||||
|
'select',
|
||||||
|
'textarea',
|
||||||
];
|
];
|
||||||
ready(() => {
|
ready(() => {
|
||||||
// get all input-radio's and add for each an onChange event listener
|
// get all input-radio's and add for each an onChange event listener
|
||||||
document.querySelectorAll('input[type="radio"]').forEach((radioElement) => {
|
document.querySelectorAll('input[type="radio"]').forEach((radioElement) => {
|
||||||
// build selector and get all corrsponding elements for this input-radio
|
// build selector and get all corrsponding elements for this input-radio
|
||||||
const selector = DISABLE_ELEMENTS.map((tagName) => (
|
const selector = DISABLE_ELEMENTS.map(
|
||||||
`${tagName}[data-radio-name="${radioElement.name}"][data-radio-value]`
|
(tagName) => `${tagName}[data-radio-name="${radioElement.name}"][data-radio-value]`
|
||||||
)).join(',');
|
).join(',');
|
||||||
const elements = Array.from(document.querySelectorAll(selector));
|
const elements = Array.from(document.querySelectorAll(selector));
|
||||||
|
|
||||||
// set all states one time on init for each of the corresponding elements
|
// set all states one time on init for each of the corresponding elements
|
||||||
|
|
Loading…
Reference in New Issue