aboutsummaryrefslogtreecommitdiff
path: root/src/main/resources/js/fileview.js
diff options
context:
space:
mode:
authorMarvin Borner2019-04-15 21:42:21 +0200
committerMarvin Borner2019-04-15 21:42:21 +0200
commit21e2156e97f339a8e8c5cb73f9bd260aa20c3dcd (patch)
treee158abe6bbd70cbfc2d1af1424155deddc92e1ce /src/main/resources/js/fileview.js
parent1ee7bb209d0f3a66b00d34edc57661e31a846e49 (diff)
Fixed duplicate scrollbars in previews
Diffstat (limited to 'src/main/resources/js/fileview.js')
-rw-r--r--src/main/resources/js/fileview.js4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/main/resources/js/fileview.js b/src/main/resources/js/fileview.js
index 78ed951..ace7884 100644
--- a/src/main/resources/js/fileview.js
+++ b/src/main/resources/js/fileview.js
@@ -1,6 +1,6 @@
const preview = document.getElementById("preview");
const content = document.getElementById("content");
-const contentCode = document.querySelector("#content > code");
+const body = document.getElementsByTagName("body")[0];
// buttons
const raw = document.getElementById("raw");
@@ -23,11 +23,13 @@ if (extension === "md" || extension === "html") {
raw.addEventListener("click", () => {
if (preview.style.display === "block") {
+ body.style.overflow = "visible";
raw.innerText = "Show preview";
preview.style.display = "none";
content.style.display = "block";
settings.style.display = "block";
} else {
+ body.style.overflow = "hidden";
raw.innerText = "Show raw";
preview.style.display = "block";
content.style.display = "none";