Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: static/js/main.js

Issue 29488555: Issue 5406 - Create Site Footer Component for Help Center (Closed)
Patch Set: Fix spacing in custom-select-options li Created Sept. 12, 2017, 3:03 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « settings.ini ('k') | static/scss/base/_utilities.scss » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
}());
« no previous file with comments | « settings.ini ('k') | static/scss/base/_utilities.scss » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld