Chromium Code Reviews| Index: ui/webui/resources/js/util.js |
| diff --git a/ui/webui/resources/js/util.js b/ui/webui/resources/js/util.js |
| index 28a60d2ce1378e6c9609170c4aad62c3d547c856..33b26eb47b1bc6f2e67ac9dd9993211d161a4bf4 100644 |
| --- a/ui/webui/resources/js/util.js |
| +++ b/ui/webui/resources/js/util.js |
| @@ -10,7 +10,11 @@ |
| * @return {HTMLElement} The found element or null if not found. |
| */ |
| function $(id) { |
| + // Disable getElementById restriction here, since we are instructing other |
| + // places to re-use the $() that is defined here. |
| + /* eslint-disable no-restricted-properties */ |
|
Dan Beam
2017/06/02 23:01:58
why not
var el = document.getElementById(id); //
dpapad
2017/06/02 23:30:03
Done. I was not aware of eslint-disable-line and e
|
| var el = document.getElementById(id); |
| + /* eslint-enable no-restricted-properties */ |
| return el ? assertInstanceof(el, HTMLElement) : null; |
| } |
| @@ -22,7 +26,7 @@ function $(id) { |
| * @return {Element} The found element or null if not found. |
| */ |
| function getSVGElement(id) { |
| - var el = document.getElementById(id); |
| + var el = $(id); |
| return el ? assertInstanceof(el, Element) : null; |
| } |