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

Unified Diff: options.js

Issue 29339231: Issue 3882 - Make checkbox labels sensitive on the option page (Closed)
Patch Set: Created March 31, 2016, 4:39 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 | « options.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: options.js
===================================================================
--- a/options.js
+++ b/options.js
@@ -87,14 +87,21 @@
listItem.setAttribute("data-access", item.url || item.text);
var labelId = "label-" + (++maxLabelId);
- listItem.querySelector(".display").setAttribute("id", labelId);
+ var label = listItem.querySelector(".display");
+ label.setAttribute("id", labelId);
+
var control = listItem.querySelector(".control");
if (control)
{
- // We use aria-labelledby to avoid triggering the control when
- // interacting with the label
control.setAttribute("aria-labelledby", labelId);
Thomas Greiner 2016/03/31 16:54:37 Since we no longer need to prevent the control fro
Sebastian Noack 2016/03/31 17:18:12 I briefly tried that but it somehow breaks the sur
control.addEventListener("click", this.details[j].onClick, false);
+
+ if (label.localName == "label")
+ {
+ var controlId = "control-" + maxLabelId;
+ control.setAttribute("id", controlId);
+ label.setAttribute("for", controlId);
+ }
}
this._setEmpty(table, null);
« no previous file with comments | « options.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld