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

Side by Side 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.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « options.html ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * This file is part of Adblock Plus <https://adblockplus.org/>, 2 * This file is part of Adblock Plus <https://adblockplus.org/>,
3 * Copyright (C) 2006-2016 Eyeo GmbH 3 * Copyright (C) 2006-2016 Eyeo GmbH
4 * 4 *
5 * Adblock Plus is free software: you can redistribute it and/or modify 5 * Adblock Plus is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 3 as 6 * it under the terms of the GNU General Public License version 3 as
7 * published by the Free Software Foundation. 7 * published by the Free Software Foundation.
8 * 8 *
9 * Adblock Plus is distributed in the hope that it will be useful, 9 * Adblock Plus is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 var table = E(this.details[j].id); 80 var table = E(this.details[j].id);
81 var template = table.querySelector("template"); 81 var template = table.querySelector("template");
82 for (var i = 0; i < arguments.length; i++) 82 for (var i = 0; i < arguments.length; i++)
83 { 83 {
84 var item = arguments[i]; 84 var item = arguments[i];
85 var listItem = document.createElement("li"); 85 var listItem = document.createElement("li");
86 listItem.appendChild(document.importNode(template.content, true)); 86 listItem.appendChild(document.importNode(template.content, true));
87 listItem.setAttribute("data-access", item.url || item.text); 87 listItem.setAttribute("data-access", item.url || item.text);
88 88
89 var labelId = "label-" + (++maxLabelId); 89 var labelId = "label-" + (++maxLabelId);
90 listItem.querySelector(".display").setAttribute("id", labelId); 90 var label = listItem.querySelector(".display");
91 label.setAttribute("id", labelId);
92
91 var control = listItem.querySelector(".control"); 93 var control = listItem.querySelector(".control");
92 if (control) 94 if (control)
93 { 95 {
94 // We use aria-labelledby to avoid triggering the control when
95 // interacting with the label
96 control.setAttribute("aria-labelledby", labelId); 96 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
97 control.addEventListener("click", this.details[j].onClick, false); 97 control.addEventListener("click", this.details[j].onClick, false);
98
99 if (label.localName == "label")
100 {
101 var controlId = "control-" + maxLabelId;
102 control.setAttribute("id", controlId);
103 label.setAttribute("for", controlId);
104 }
98 } 105 }
99 106
100 this._setEmpty(table, null); 107 this._setEmpty(table, null);
101 if (table.hasChildNodes()) 108 if (table.hasChildNodes())
102 { 109 {
103 table.insertBefore(listItem, 110 table.insertBefore(listItem,
104 table.childNodes[this.items.indexOf(item)]); 111 table.childNodes[this.items.indexOf(item)]);
105 } 112 }
106 else 113 else
107 table.appendChild(listItem); 114 table.appendChild(listItem);
(...skipping 1028 matching lines...) Expand 10 before | Expand all | Expand 10 after
1136 }); 1143 });
1137 ext.backgroundPage.sendMessage( 1144 ext.backgroundPage.sendMessage(
1138 { 1145 {
1139 type: "subscriptions.listen", 1146 type: "subscriptions.listen",
1140 filter: ["added", "disabled", "homepage", "lastDownload", "removed", 1147 filter: ["added", "disabled", "homepage", "lastDownload", "removed",
1141 "title"] 1148 "title"]
1142 }); 1149 });
1143 1150
1144 window.addEventListener("DOMContentLoaded", onDOMLoaded, false); 1151 window.addEventListener("DOMContentLoaded", onDOMLoaded, false);
1145 })(); 1152 })();
OLDNEW
« no previous file with comments | « options.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld