diff --git a/assets/index.css b/assets/index.css
index a4fa414..bbc9f8e 100644
--- a/assets/index.css
+++ b/assets/index.css
@@ -98,8 +98,8 @@ body {
}
.empty-folder {
- display: block;
padding-top: 1rem;
+ font-style: italic;
}
.uploaders-table th,
diff --git a/assets/index.html b/assets/index.html
index 7a2f543..39caf9c 100644
--- a/assets/index.html
+++ b/assets/index.html
@@ -31,6 +31,7 @@
+
diff --git a/assets/index.js b/assets/index.js
index 4e3d9d3..a60286e 100644
--- a/assets/index.js
+++ b/assets/index.js
@@ -17,7 +17,19 @@ const dirEmptyNote = params.q ? 'No results' : DATA.dir_exists ? 'Empty folder'
/**
* @type Element
*/
-let $pathsTable, $pathsTableBody, $uploadersTable;
+let $pathsTable;
+/**
+ * @type Element
+ */
+let $pathsTableBody;
+/**
+ * @type Element
+ */
+let $uploadersTable;
+/**
+ * @type Element
+ */
+let $emptyFolder;
/**
* @type string
*/
@@ -59,8 +71,8 @@ class Uploader {
|
`);
$uploadersTable.classList.remove("hidden");
+ $emptyFolder.classList.add("hidden");
this.$uploadStatus = document.getElementById(`uploadStatus${idx}`);
- document.querySelector('.main i.empty-folder').remove();
const ajax = new XMLHttpRequest();
ajax.upload.addEventListener("progress", e => this.progress(e), false);
@@ -187,8 +199,8 @@ async function deletePath(index) {
DATA.paths[index] = null;
if (!DATA.paths.find(v => !!v)) {
$pathsTable.classList.add("hidden");
- document.querySelector('.main').insertAdjacentHTML("afterbegin", '');
- document.querySelector('.main .empty-folder').textContent = dirEmptyNote;
+ $emptyFolder.textContent = dirEmptyNote;
+ $emptyFolder.classList.remove("hidden");
}
} else {
throw new Error(await res.text())
@@ -283,6 +295,7 @@ function ready() {
$pathsTable = document.querySelector(".paths-table")
$pathsTableBody = document.querySelector(".paths-table tbody");
$uploadersTable = document.querySelector(".uploaders-table");
+ $emptyFolder = document.querySelector(".empty-folder");
if (params.q) {
document.getElementById('search').value = params.q;
@@ -298,8 +311,8 @@ function ready() {
addPath(DATA.paths[i], i);
}
if (len == 0) {
- document.querySelector('.main').insertAdjacentHTML("afterbegin", '');
- document.querySelector('.main .empty-folder').textContent = dirEmptyNote;
+ $emptyFolder.textContent = dirEmptyNote;
+ $emptyFolder.classList.remove("hidden");
}
}
if (DATA.allow_upload) {