aboutsummaryrefslogtreecommitdiff
path: root/src/main/resources/js
diff options
context:
space:
mode:
authorMarvin Borner2019-05-04 21:41:14 +0200
committerMarvin Borner2019-05-04 21:41:14 +0200
commite5cf2266d703e84873c008604874d88954c2bb2a (patch)
treef39fa88d95c4c19ca035cb34936754eac6538628 /src/main/resources/js
parentb7540fb2b1bbe016d23b8a7f3e7ab3edafb219c8 (diff)
Minor bug fixes
Co-authored-by: LarsVomMars <lars@kroenner.eu>
Diffstat (limited to 'src/main/resources/js')
-rw-r--r--src/main/resources/js/files.js11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/main/resources/js/files.js b/src/main/resources/js/files.js
index 0102296..2225aa0 100644
--- a/src/main/resources/js/files.js
+++ b/src/main/resources/js/files.js
@@ -27,9 +27,14 @@ drop.addEventListener('drop', e => {
const row = document.getElementById("table").insertRow(-1);
row.setAttribute("data-href", file.name);
- // TODO: Differentiate between file and directory upload in frontend
- row.insertCell(0).innerHTML = "<td><i class='icon ion-md-document'></i></td>";
- row.insertCell(1).innerHTML = file.name;
+
+ if (item.isDirectory) {
+ row.insertCell(0).innerHTML = "<td><i class='icon ion-md-folder'></i></td>";
+ row.insertCell(1).innerHTML = file.name + "/";
+ } else {
+ row.insertCell(0).innerHTML = "<td><i class='icon ion-md-document'></i></td>";
+ row.insertCell(1).innerHTML = file.name;
+ }
row.insertCell(2).innerHTML = bytesToSize(file.size);
row.insertCell(3).innerHTML = `${date.getMonth() + 1}/${date.getDate()}/${date.getFullYear()} ${date.getHours()}:${date.getMinutes()}:${date.getSeconds()}`;
row.insertCell(4).innerHTML = "<td><button class='share'><i class='icon ion-md-share'></i></button></td>";