diff options
author | Marvin Borner | 2019-04-15 21:42:21 +0200 |
---|---|---|
committer | Marvin Borner | 2019-04-15 21:42:21 +0200 |
commit | 21e2156e97f339a8e8c5cb73f9bd260aa20c3dcd (patch) | |
tree | e158abe6bbd70cbfc2d1af1424155deddc92e1ce /src/main/resources/js | |
parent | 1ee7bb209d0f3a66b00d34edc57661e31a846e49 (diff) |
Fixed duplicate scrollbars in previews
Diffstat (limited to 'src/main/resources/js')
-rw-r--r-- | src/main/resources/js/fileview.js | 4 |
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"; |