From 583117c01fa79294c66ff66847a4ed3e529afc75 Mon Sep 17 00:00:00 2001 From: sigoden Date: Thu, 30 Jun 2022 10:00:42 +0800 Subject: [PATCH] fix: safari layout and compatibility (#83) --- assets/index.css | 2 +- assets/index.js | 42 +++++++++++++++--------------------------- 2 files changed, 16 insertions(+), 28 deletions(-) diff --git a/assets/index.css b/assets/index.css index ab0e96c..7f5764b 100644 --- a/assets/index.css +++ b/assets/index.css @@ -149,7 +149,7 @@ body { } .path svg { - height: 100%; + height: 16px; fill: rgba(3,47,98,0.5); padding-right: 0.5em; vertical-align: text-top; diff --git a/assets/index.js b/assets/index.js index 22349ef..77d422d 100644 --- a/assets/index.js +++ b/assets/index.js @@ -32,31 +32,17 @@ let $emptyFolder; class Uploader { /** - * @type number + * + * @param {File} file + * @param {string[]} dirs */ - idx; - /** - * @type File - */ - file; - /** - * @type string - */ - name; - /** - * @type Element - */ - $uploadStatus; - /** - * @type number - */ - uploaded = 0; - /** - * @type number - */ - lastUptime = 0; - static globalIdx = 0; constructor(file, dirs) { + /** + * @type Element + */ + this.$uploadStatus = null + this.uploaded = 0; + this.lastUptime = 0; this.name = [...dirs, file.name].join("/"); this.idx = Uploader.globalIdx++; this.file = file; @@ -70,7 +56,7 @@ class Uploader { $uploadersTable.insertAdjacentHTML("beforeend", ` - ${getSvg(file.path_type)} + ${getSvg()} ${encodedName} @@ -120,6 +106,8 @@ class Uploader { } } +Uploader.globalIdx = 0; + /** * Add breadcrumb * @param {string} href @@ -292,12 +280,12 @@ function getSvg(path_type) { switch (path_type) { case "Dir": return ``; - case "File": - return ``; + case "SymlinkFile": + return ``; case "SymlinkDir": return ``; default: - return ``; + return ``; } }