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

Unified Diff: common.js

Issue 29496555: Noissue - Fix setLinks related ESLint errors (Closed)
Patch Set: Created July 24, 2017, 9:08 a.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 | « no previous file | firstRun.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: common.js
diff --git a/common.js b/common.js
index 35cb61f9f6d5d4ac19bc5bcbd63326865ff1dc2f..5dbf617ed192bf1ad50d2287a51d1e5ac6a41614 100644
--- a/common.js
+++ b/common.js
@@ -34,29 +34,29 @@ function getDocLink(link, callback)
}
function setLinks(id, ...args)
+{
kzar 2017/07/24 09:10:02 The diff here looks ugly, but really I just remove
Thomas Greiner 2017/07/24 10:26:18 Acknowledged. Thanks for pointing that out.
+ let element = E(id);
+ if (!element)
{
- let element = E(id);
- if (!element)
- {
- return;
- }
+ return;
+ }
- let links = element.getElementsByTagName("a");
+ let links = element.getElementsByTagName("a");
- for (let i = 0; i < links.length; i++)
+ for (let i = 0; i < links.length; i++)
+ {
+ if (typeof args[i] == "string")
{
- if (typeof args[i] == "string")
- {
- links[i].href = args[i];
- links[i].setAttribute("target", "_blank");
- }
- else if (typeof args[i] == "function")
- {
- links[i].href = "javascript:void(0);";
- links[i].addEventListener("click", args[i], false);
- }
+ links[i].href = args[i];
+ links[i].setAttribute("target", "_blank");
+ }
+ else if (typeof args[i] == "function")
+ {
+ links[i].href = "javascript:void(0);";
+ links[i].addEventListener("click", args[i], false);
}
}
+}
function checkShareResource(url, callback)
{
« no previous file with comments | « no previous file | firstRun.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld