diff --git a/src/main/resources/templates/multi-tool.html b/src/main/resources/templates/multi-tool.html index b4cae58d..5d911403 100644 --- a/src/main/resources/templates/multi-tool.html +++ b/src/main/resources/templates/multi-tool.html @@ -10,12 +10,16 @@


-
+

+
+
+
+
@@ -158,6 +162,7 @@ const moveUpButtonCallback = e => { var imgContainer = e.target; + const startingPosition = imgContainer.getBoundingClientRect(); while (!imgContainer.classList.contains("page-container")) { imgContainer = imgContainer.parentNode; } @@ -165,9 +170,10 @@ if (sibling) { pagesContainer.removeChild(imgContainer); pagesContainer.insertBefore(imgContainer, sibling); - imgContainer.scrollIntoView({ - behavior: "instant", - block: "center", + + const { width } = imgContainer.getBoundingClientRect(); + pagesContainerWrapper.scroll({ + left: pagesContainerWrapper.scrollLeft - width, }) } }; @@ -184,9 +190,9 @@ } else { pagesContainer.appendChild(imgContainer) } - imgContainer.scrollIntoView({ - behavior: "instant", - block: "center", + const { width } = imgContainer.getBoundingClientRect(); + pagesContainerWrapper.scroll({ + left: pagesContainerWrapper.scrollLeft + width, }) } }; @@ -434,6 +440,10 @@