mirror of
https://github.com/Frooodle/Stirling-PDF.git
synced 2024-12-21 19:08:24 +01:00
added a remove button issue#529
This commit is contained in:
parent
63eacf443e
commit
bbd8de0899
@ -21,6 +21,7 @@ function displayFiles(files) {
|
||||
<div class="arrows d-flex">
|
||||
<button class="btn btn-secondary move-up"><span>↑</span></button>
|
||||
<button class="btn btn-secondary move-down"><span>↓</span></button>
|
||||
<button class="btn btn-danger remove-file"><span>×</span></button>
|
||||
</div>
|
||||
</div>
|
||||
`;
|
||||
@ -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() {
|
||||
|
Loading…
Reference in New Issue
Block a user