From 6825b9e5aa3f4e4cec0bb20438934aece6250e37 Mon Sep 17 00:00:00 2001 From: Simon Bruder Date: Mon, 20 Jul 2020 12:14:37 +0200 Subject: [PATCH] Only open directories automatically --- assets/listing.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/assets/listing.js b/assets/listing.js index 9ff7365..1c397eb 100644 --- a/assets/listing.js +++ b/assets/listing.js @@ -67,7 +67,10 @@ document.addEventListener('DOMContentLoaded', () => { const visibleRows = rows.filter(row => row.style.display === 'table-row') if (visibleRows.length === 1) { - window.location = visibleRows[0].querySelector('td a').href + const target = visibleRows[0].querySelector('td a').href + if (target.substr(-1) === '/') { + window.location = target + } } }) })