diff --git a/copyparty/web/browser.js b/copyparty/web/browser.js index 86e941e7..3cc22fd2 100644 --- a/copyparty/web/browser.js +++ b/copyparty/web/browser.js @@ -2680,14 +2680,12 @@ var thegrid = (function () { href = noq_href(this), aplay = ebi('a' + oth.getAttribute('id')), is_img = /\.(gif|jpe?g|png|webp|webm|mp4)(\?|$)/i.test(href), - in_tree = null, + is_dir = href.endsWith('/'), + in_tree = is_dir && treectl.find(oth.textContent.slice(0, -1)), have_sel = QS('#files tr.sel'), td = oth.closest('td').nextSibling, tr = td.parentNode; - if (href.endsWith('/')) - in_tree = treectl.find(oth.textContent.slice(0, -1)); - if (r.sel && !dbl) { td.click(); clmod(this, 'sel', clgot(tr, 'sel')); @@ -2698,6 +2696,9 @@ var thegrid = (function () { else if (in_tree && !have_sel) in_tree.click(); + else if (is_dir && !have_sel && treectl.spa) + treectl.reqls(href, true, true); + else if (!is_img && have_sel) window.open(href, '_blank');