| Left: | ||
| Right: |
| OLD | NEW |
|---|---|
| (Empty) | |
| 1 (function(){ | |
| 2 document.addEventListener("DOMContentLoaded", function() { | |
|
juliandoucette
2017/08/22 14:33:42
NIT: We are supposed to put brackets on the next l
ire
2017/09/04 20:28:06
Done.
| |
| 3 | |
| 4 // Change html class name from "no-js" to "js" | |
| 5 document.documentElement.className = "js"; | |
| 6 | |
| 7 // Custom Select | |
| 8 var customSelects = document.getElementsByClassName('custom-select-selected' ); | |
| 9 function onClickCustomSelect(e) { | |
| 10 var options = e.target.nextElementSibling; | |
| 11 if (options.getAttribute("aria-hidden") == "true") | |
| 12 { | |
| 13 options.removeAttribute("aria-hidden"); | |
| 14 e.target.setAttribute("aria-expanded", "true"); | |
| 15 } | |
| 16 else | |
| 17 { | |
| 18 options.setAttribute("aria-hidden", "true"); | |
| 19 e.target.setAttribute("aria-expanded", "false"); | |
| 20 } | |
| 21 } | |
| 22 for (var i = 0; i < customSelects.length; i++) { | |
| 23 customSelects[i].addEventListener("click", onClickCustomSelect, false); | |
|
juliandoucette
2017/08/22 14:33:41
NIT: We could handle this event on the body instea
ire
2017/09/04 20:28:06
Agreed. I would like to change the way both this a
juliandoucette
2017/09/06 17:48:19
Acknowledged.
| |
| 24 } | |
| 25 | |
| 26 }, false); | |
| 27 }()); | |
| OLD | NEW |