fix: show only selected files for merge tool

This commit is contained in:
Michel Heusschen 2024-01-23 16:06:57 +01:00
parent 46032b8ebb
commit 166fa0eb87

View file

@ -8,11 +8,18 @@ document.getElementById("fileInput-input").addEventListener("change", function()
displayFiles(files); displayFiles(files);
}); });
/**
* @param {FileList} files
*/
function displayFiles(files) { function displayFiles(files) {
var list = document.getElementById("selectedFiles"); const list = document.getElementById("selectedFiles");
for (var i = 0; i < files.length; i++) { while (list.firstChild) {
var item = document.createElement("li"); list.removeChild(list.firstChild);
}
for (let i = 0; i < files.length; i++) {
const item = document.createElement("li");
item.className = "list-group-item"; item.className = "list-group-item";
item.innerHTML = ` item.innerHTML = `
<div class="d-flex justify-content-between align-items-center w-100"> <div class="d-flex justify-content-between align-items-center w-100">