Merge pull request #737 from michelheusschen/fix/merge-tool-file-selection

fix: show only selected files for merge tool
This commit is contained in:
Anthony Stirling 2024-01-28 20:22:45 +00:00 committed by GitHub
commit 07e9fcb6cc
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

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">