1
0
mirror of https://github.com/Stirling-Tools/Stirling-PDF.git synced 2024-07-07 09:50:08 +02:00

Merge pull request #615 from mannam11/added-remove-button-529

added a remove button issue#529
This commit is contained in:
Anthony Stirling 2023-12-30 11:27:18 +00:00 committed by GitHub
commit 279cfa70f5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -20,6 +20,7 @@ function displayFiles(files) {
<div class="arrows d-flex">
<button class="btn btn-secondary move-up"><span>&uarr;</span></button>
<button class="btn btn-secondary move-down"><span>&darr;</span></button>
<button class="btn btn-danger remove-file"><span>&times;</span></button>
</div>
</div>
`;
@ -55,6 +56,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() {