diff --git a/src/main/resources/static/js/merge.js b/src/main/resources/static/js/merge.js index d27730b9..1c7adf85 100644 --- a/src/main/resources/static/js/merge.js +++ b/src/main/resources/static/js/merge.js @@ -21,6 +21,7 @@ function displayFiles(files) {
+
`; @@ -56,6 +57,16 @@ function attachMoveButtons() { } }); } + + var removeButtons = document.querySelectorAll(".remove-file"); + for (var i = 0; i < removeButtons.length; i++) { + removeButtons[i].addEventListener("click", function (event) { + event.preventDefault(); + var parent = this.closest(".list-group-item"); + parent.remove(); + updateFiles(); + }); + } } document.getElementById("sortByNameBtn").addEventListener("click", function() {