Skip to content
Snippets Groups Projects
Commit 1e7a044a authored by Haakon Gunleiksrud's avatar Haakon Gunleiksrud
Browse files

feat/add preview of image in workout if image file

parent 37f14a8e
No related branches found
No related tags found
1 merge request!16feat/add preview of image in workout if image file
Pipeline #138839 passed
This commit is part of merge request !16. Comments created here will be created in the context of that merge request.
......@@ -42,6 +42,15 @@ async function retrieveWorkout(id) {
a.text = pathArray[pathArray.length - 1];
a.className = "me-2";
filesDiv.appendChild(a);
let isImage = ["jpg", "png", "gif", "jpeg"].includes(a.text.split(".")[1]);
if(isImage){
let img = document.createElement("img");
img.src = file.file;
img.width = "500";
filesDiv.appendChild(img);
}
}
// create exercises
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment