aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarvin Borner2019-04-15 21:42:21 +0200
committerMarvin Borner2019-04-15 21:42:21 +0200
commit21e2156e97f339a8e8c5cb73f9bd260aa20c3dcd (patch)
treee158abe6bbd70cbfc2d1af1424155deddc92e1ce
parent1ee7bb209d0f3a66b00d34edc57661e31a846e49 (diff)
Fixed duplicate scrollbars in previews
-rw-r--r--src/main/resources/css/fileview.css8
-rw-r--r--src/main/resources/css/layout.css4
-rw-r--r--src/main/resources/js/fileview.js4
3 files changed, 11 insertions, 5 deletions
diff --git a/src/main/resources/css/fileview.css b/src/main/resources/css/fileview.css
index 8341a80..4e24b33 100644
--- a/src/main/resources/css/fileview.css
+++ b/src/main/resources/css/fileview.css
@@ -1,11 +1,15 @@
+html, body {
+ max-width: 100vw;
+ overflow: hidden;
+}
+
.preview, .switch, .settings {
display: none;
}
-/* TODO: Fix duplicate scrollbars in previews */
.prettyprint, .preview {
position: absolute;
- min-height: 100%;
+ height: 100%;
width: 100%;
border: none !important;
overflow: visible;
diff --git a/src/main/resources/css/layout.css b/src/main/resources/css/layout.css
index 9c03575..c0d7366 100644
--- a/src/main/resources/css/layout.css
+++ b/src/main/resources/css/layout.css
@@ -3,8 +3,8 @@ html, body {
color: #424242;
padding: 0;
margin: 0;
- min-width: 100vw !important;
- min-height: 100vh !important;
+ min-width: 100vw;
+ min-height: 100vh;
}
button {
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";