Last active
June 22, 2016 19:48
-
-
Save alansemenov/96f9ba838b18b3eab95f3bc430a81c77 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function materializeRadioButtons() { | |
var parentEl; | |
document.querySelectorAll('input[type="radio"]').forEach(function(control) { | |
parentEl = control.parentElement; | |
control.classList.add('mdl-radio__button'); | |
if (parentEl.tagName == "LABEL") { | |
parentEl.setAttribute('for', control.id || control.name) | |
parentEl.classList.add('mdl-radio', 'mdl-js-radio', 'mdl-js-ripple-effect'); | |
} | |
}); | |
} | |
function materializeControls() { | |
materializeTextInputs(); | |
materializeSelects(); | |
materializeRadioButtons(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment