diff --git a/copyparty/httpcli.py b/copyparty/httpcli.py
index 0e6a95ea..37f99834 100644
--- a/copyparty/httpcli.py
+++ b/copyparty/httpcli.py
@@ -7208,7 +7208,7 @@ class HttpCli(object):
and vpath
)
for fn in ls_names:
- base = ""
+ cls = base = ""
href = fn
if use_abs_url:
base = "/" + vpath + "/"
@@ -7228,6 +7228,7 @@ class HttpCli(object):
is_dir = stat.S_ISDIR(inf.st_mode)
if is_dir:
+ cls = "dir"
href += "/"
if no_zip:
margin = "DIR"
@@ -7297,6 +7298,7 @@ class HttpCli(object):
"ext": ext,
"dt": dt,
"ts": int(linf.st_mtime),
+ "cls": cls,
}
if is_dir:
dirs.append(item)
diff --git a/copyparty/web/browser.css b/copyparty/web/browser.css
index fa0036d3..44290e85 100644
--- a/copyparty/web/browser.css
+++ b/copyparty/web/browser.css
@@ -636,7 +636,7 @@ a:hover {
a.dir {
color: var(--a);
}
-tr:has(a.dir) td:nth-child(2) a::before {
+tr.dir td:nth-child(2) a::before {
content: "📁";
margin: 0 .1em 0 -.2em;
}
diff --git a/copyparty/web/browser.js b/copyparty/web/browser.js
index bbdcb83a..cbe7229e 100644
--- a/copyparty/web/browser.js
+++ b/copyparty/web/browser.js
@@ -6232,10 +6232,6 @@ var thegrid = (function () {
if (!ref)
continue;
var cl = ebi(ref).closest('tr').className || '';
-
- if (noq_href(ths[a]).endsWith('/'))
- cl += ' dir';
-
ths[a].className = cl;
var chk = ths[a].getElementsByTagName('input')[0];
@@ -6315,8 +6311,8 @@ var thegrid = (function () {
ext0 = '',
name = uricom_dec(vsplit(href)[1]),
ref = ao.getAttribute('id'),
- isdir = href.endsWith('/'),
- ac = isdir ? ' class="dir"' : '',
+ isdir = clgot(ao.parentElement.parentElement, 'dir'),
+ ac = ao.parentElement.parentElement.classList,
ihref = ohref;
if (need_ext && href != "#") {
@@ -6369,12 +6365,12 @@ var thegrid = (function () {
ihref += "&raster";
html.push('' +
+ '" class="' + ac + '" ttt="' + esc(name) + '">' +
'