From bbd8de0899307dc8bc3884df5f4e79bfb12843cb Mon Sep 17 00:00:00 2001 From: mannam <101550345+ManoharMannam@users.noreply.github.com> Date: Sat, 30 Dec 2023 16:42:41 +0530 Subject: [PATCH] added a remove button issue#529 --- src/main/resources/static/js/merge.js | 11 +++++++++++ 1 file changed, 11 insertions(+) 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() {