Index: static/js/main.js |
=================================================================== |
--- a/static/js/main.js |
+++ b/static/js/main.js |
@@ -18,10 +18,36 @@ |
var toggleNavbarCollapseEls = document.getElementsByClassName("toggle-navbar-collapse"); |
for (var i = 0; i < toggleNavbarCollapseEls.length; i++) |
{ |
toggleNavbarCollapseEls[i] |
.addEventListener("click", toggleNavbarCollapse, false); |
} |
+ // Custom Select |
+ function onClickCustomSelect() |
+ { |
+ var options = this.nextElementSibling; |
+ if (options.getAttribute("aria-hidden") == "true") |
+ { |
+ options.removeAttribute("aria-hidden"); |
+ this.setAttribute("aria-expanded", "true"); |
+ } |
+ else |
+ { |
+ options.setAttribute("aria-hidden", "true"); |
+ this.setAttribute("aria-expanded", "false"); |
+ } |
+ } |
+ |
+ var customSelectEls = document.getElementsByClassName('custom-select-selected'); |
+ for (var i = 0; i < customSelectEls.length; i++) |
+ { |
+ customSelectEls[i] |
+ .addEventListener("click", onClickCustomSelect, false); |
+ customSelectEls[i] |
+ .nextElementSibling |
+ .setAttribute("aria-hidden", "true"); |
+ } |
+ |
}, false); |
}()); |