0.0.04 form poster
This commit is contained in:
14
static/v2/js/widgets/w_radio_inputs.js
Normal file
14
static/v2/js/widgets/w_radio_inputs.js
Normal file
@@ -0,0 +1,14 @@
|
||||
function chooseRadioInput(el, callback){
|
||||
if (!el) return;
|
||||
let $parent = el.closest('.w_radio_inputs');
|
||||
if (!$parent) return;
|
||||
|
||||
let $radios = $parent.querySelectorAll('.radio');
|
||||
$radios.forEach(radio => {
|
||||
radio.classList.remove('checked')
|
||||
})
|
||||
el.classList.toggle("checked");
|
||||
|
||||
let checked_state = el.classList.contains("checked");
|
||||
if (callback) callback(checked_state)
|
||||
}
|
||||
Reference in New Issue
Block a user