diff --git a/src/main/resources/templates/fragments/common.html b/src/main/resources/templates/fragments/common.html
index 18352416..4340d5e8 100644
--- a/src/main/resources/templates/fragments/common.html
+++ b/src/main/resources/templates/fragments/common.html
@@ -102,7 +102,7 @@
+
+
+
-
@@ -54,14 +56,11 @@
fileInput.addEventListener("change", async function() {
console.log("loading pdf");
- preview.parentElement.style.display = "block";
- document.querySelector(".buttonContainer").style.display = "flex";
+ document.querySelector("#editSection").style.display = "";
- var file = fileInput.files[0];
- var url = URL.createObjectURL(file)
- var loadingTask = pdfjsLib.getDocument(url);
+ var url = URL.createObjectURL(fileInput.files[0])
- const pdf = await loadingTask.promise;
+ const pdf = await pdfjsLib.getDocument(url).promise;
const page = await pdf.getPage(1);
const canvas = document.createElement("canvas");
@@ -77,8 +76,8 @@
// render the page onto the canvas
var renderContext = {
- canvasContext: canvas.getContext("2d"),
- viewport: page.getViewport({ scale: 1 })
+ canvasContext: canvas.getContext("2d"),
+ viewport: page.getViewport({ scale: 1 })
};
await page.render(renderContext).promise;
@@ -115,20 +114,17 @@
width: 100%;
border: 1px solid rgba(0,0,0,.125);
border-radius: 0.25rem;
- margin: 1rem 0 0;
+ margin: 1rem 0;
padding: 15px;
- display: none;
+ display: block;
overflow: hidden;
position: relative;
}
.buttonContainer {
- display: none;
+ display: flex;
justify-content: space-around;
}
- button {
- top-margin: -100%;
- }