aboutsummaryrefslogtreecommitdiff
path: root/html/display_panel/content/main_panel.js
diff options
context:
space:
mode:
authorhackademix <giorgio@maone.net>2019-02-25 23:05:22 +0100
committerhackademix <giorgio@maone.net>2019-02-25 23:05:22 +0100
commit5d9ab3778bcdb12913333deff64196590688789f (patch)
tree2423bfebc6d5fa0727edbfb3dbc2ebaa13615c70 /html/display_panel/content/main_panel.js
parent881101334654012dd2289b5a73f123bb5d55a462 (diff)
Cosmetic changes to the inline code viewer toggle button.
Diffstat (limited to 'html/display_panel/content/main_panel.js')
-rw-r--r--html/display_panel/content/main_panel.js11
1 files changed, 10 insertions, 1 deletions
diff --git a/html/display_panel/content/main_panel.js b/html/display_panel/content/main_panel.js
index 60eae55..022be8c 100644
--- a/html/display_panel/content/main_panel.js
+++ b/html/display_panel/content/main_panel.js
@@ -55,8 +55,17 @@ liTemplate.remove();
document.querySelector("#info").addEventListener("click", e => {
let button = e.target;
+ if (button.tagName === "A") {
+ setTimeout(close, 100);
+ return;
+ }
if (button.matches(".toggle-source")) {
- let sourceContainer = button.parentNode.querySelector(".source").classList.toggle("visible");
+ let parent = button.parentNode;
+ if (!parent.querySelector(".source").textContent) {
+ parent.querySelector("a").click();
+ } else {
+ parent.classList.toggle("visible");
+ }
return;
}
if (!button.matches(".buttons > button")) return;