From 94438fa34f7ea57f49e387a8e6385d95ac7d60ad Mon Sep 17 00:00:00 2001 From: mattpass Date: Sun, 25 Jul 2021 17:06:39 +0100 Subject: [PATCH] Skip dirs in multiple results, close dir handle when done --- lib/multiple-results.php | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/lib/multiple-results.php b/lib/multiple-results.php index 24c3787..d23998d 100644 --- a/lib/multiple-results.php +++ b/lib/multiple-results.php @@ -92,6 +92,7 @@ if (true === isset($_GET['target']) && false !== strpos($_GET['target'], "filena const spansArray = parent.ICEcoder.filesFrame.contentWindow.document.getElementsByTagName('span'); for (let i = 0; i < spansArray.length; i++) { let foundInSelected = false; + const targetURLElem = spansArray[i]; const targetURL = spansArray[i].id.replace(/\|/g, "/").toLowerCase(); const targetURLDisplay = spansArray[i].id.replace(/\|/g, "/"); // Original filename incl casing const targetName = targetURL.substring(targetURL.lastIndexOf("/") + 1); @@ -118,6 +119,10 @@ if (true === isset($_GET['target']) && false !== strpos($_GET['target'], "filena } } if (-1 < userTarget.indexOf("all") || (-1 < userTarget.indexOf("selected") && foundInSelected)) { + // Skip displaying directories + if (-1 < targetURLElem.parentNode.parentNode.className.indexOf('pft-directory')) { + continue; + } resultsDisplay += '