Fix unclickable labels in onboarding

This commit is contained in:
Kevin Froman 2020-08-20 01:29:29 -05:00
parent 6089cc3c98
commit 2cf7a8c8b3
2 changed files with 28 additions and 10 deletions

View file

@ -65,4 +65,22 @@ document.getElementById('onboardingForm').onsubmit = function(e){
sendConfig(submitInfo)
e.preventDefault()
}
}
/* Fix label clicking since bulma is weird */
let labelClickFix = function(labels) {
for (i = 0; i < labels.length; i++){
labels[i].onclick = function(event){
document.getElementsByName(event.target.getAttribute("for"))[0].checked ^= 1
}
}
}
let setupLabelFix = function(){
var labels = document.getElementsByTagName('label')
var icons = document.getElementsByTagName('i')
labelClickFix(labels)
labelClickFix(icons)
}
setupLabelFix()