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) |
{ |