Fixed file additions.
This commit is contained in:
parent
ff9551dcc1
commit
c37abb6327
@ -112,10 +112,10 @@ const updateHTMLDirList = async (data) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Insert files
|
// Insert files
|
||||||
let filClone = document.importNode(filTemplate.content, true);
|
let fileClone = document.importNode(filTemplate.content, true);
|
||||||
size = files.length;
|
size = files.length;
|
||||||
for (i = 0; i < size; i++) {
|
for (i = 0; i < size; i++) {
|
||||||
const clone = imgClone.cloneNode(true);
|
const clone = fileClone.cloneNode(true);
|
||||||
let fileName = files[i].file;
|
let fileName = files[i].file;
|
||||||
createElmBlock(clone, setFileIconType(fileName), fileName);
|
createElmBlock(clone, setFileIconType(fileName), fileName);
|
||||||
}
|
}
|
||||||
@ -127,9 +127,9 @@ const createElmBlock = (elm, imgSrc, fileName, isVideo = null, path = null) => {
|
|||||||
let inputTag = elm.querySelector("input");
|
let inputTag = elm.querySelector("input");
|
||||||
|
|
||||||
if (isVideo) {
|
if (isVideo) {
|
||||||
contnrTag.style = "background-image: url('/resources/images/thumbnails/" + imgSrc + "')";
|
contnrTag.style = "background-image: url('/resources/images/thumbnails/" + imgSrc + "')";
|
||||||
inputTag.className = "videoInputField";
|
inputTag.className = "videoInputField";
|
||||||
let fullMedia = path + fileName;
|
let fullMedia = path + fileName;
|
||||||
elm.querySelector("div").addEventListener("click", function (eve) {
|
elm.querySelector("div").addEventListener("click", function (eve) {
|
||||||
openInLocalProg(fullMedia);
|
openInLocalProg(fullMedia);
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user