From c5eeedd2a5d217bac9003f1b55d201ac6ed52e34 Mon Sep 17 00:00:00 2001 From: WubzyGD Date: Tue, 19 Apr 2022 13:45:00 -0600 Subject: [PATCH] finally fix double click bug --- scripts/fileview/load/render.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/fileview/load/render.js b/scripts/fileview/load/render.js index 3b012a2..d15d11f 100755 --- a/scripts/fileview/load/render.js +++ b/scripts/fileview/load/render.js @@ -18,13 +18,13 @@ module.exports = (dir, options) => { window.kade.elc = true; if (cfc.classList.contains('file-active')) {if (file.dir) {refresh(`${window.kade.cpath}/${file.name}`);}} cfc.classList.add('file-active'); - if (window.kade.cl) {window.kade.cl.classList.remove('file-active');} + if (window.kade.cl && !cfc.isSameNode(window.kade.cl)) {window.kade.cl.classList.remove('file-active');} window.kade.cl = cfc; }; cfc.oncontextmenu = function () { window.kade.elc = true; if (!cfc.classList.contains('file-active')) {cfc.classList.add('file-active');} - if (window.kade.cl) {window.kade.cl.classList.remove('file-active');} + if (window.kade.cl && !cfc.isSameNode(window.kade.cl)) {window.kade.cl.classList.remove('file-active');} window.kade.cl = cfc; window.kade.ctxel = cfc; };