remove radio button js utility
This commit is contained in:
parent
39338c9b0d
commit
a581640f7e
@ -5,10 +5,6 @@
|
|||||||
display: flex;
|
display: flex;
|
||||||
}
|
}
|
||||||
|
|
||||||
.radio-group__option {
|
|
||||||
min-width: 30px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.radio {
|
.radio {
|
||||||
position: relative;
|
position: relative;
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
|
|||||||
@ -241,29 +241,6 @@
|
|||||||
setup: checkboxUtil,
|
setup: checkboxUtil,
|
||||||
});
|
});
|
||||||
|
|
||||||
// turns native radio buttons into custom ones
|
|
||||||
window.utils.radio = function(input) {
|
|
||||||
|
|
||||||
if (!input.parentElement.classList.contains('radio')) {
|
|
||||||
var parentEl = input.parentElement;
|
|
||||||
var siblingEl = input.nextElementSibling;
|
|
||||||
var wrapperEl = document.createElement('div');
|
|
||||||
wrapperEl.classList.add('radio');
|
|
||||||
wrapperEl.appendChild(input);
|
|
||||||
|
|
||||||
if (siblingEl && siblingEl.matches('label')) {
|
|
||||||
wrapperEl.appendChild(siblingEl);
|
|
||||||
}
|
|
||||||
|
|
||||||
parentEl.appendChild(wrapperEl);
|
|
||||||
}
|
|
||||||
|
|
||||||
return {
|
|
||||||
scope: input,
|
|
||||||
destroy: function() {},
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
// Override implicit submit (pressing enter) behaviour to trigger a specified submit button instead of the default
|
// Override implicit submit (pressing enter) behaviour to trigger a specified submit button instead of the default
|
||||||
window.utils.implicitSubmit = function(input, options) {
|
window.utils.implicitSubmit = function(input, options) {
|
||||||
var submit = options.submit;
|
var submit = options.submit;
|
||||||
|
|||||||
Reference in New Issue
Block a user