From d0aabd30bb9b494333ae81b41416f8580dd1301a Mon Sep 17 00:00:00 2001 From: WubzyGD Date: Tue, 14 Jun 2022 20:55:13 -0600 Subject: [PATCH] decompress in ctx --- scripts/contextmenu/createcontext.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/scripts/contextmenu/createcontext.js b/scripts/contextmenu/createcontext.js index 8307667..9e433ec 100755 --- a/scripts/contextmenu/createcontext.js +++ b/scripts/contextmenu/createcontext.js @@ -19,7 +19,13 @@ module.exports = (e, target, window) => { compress.style.display = 'block'; compsel.style.display = 'none'; } - document.getElementById('ctx-decompress').style.display = 'none'; + if (target.classList.contains('zip') || (target.parentElement && target.parentElement.classList.contains('zip'))) { + if (target.classList.contains('zip')) {window.kade.currentFolder = target.children[1].innerHTML.trim();} + else {window.kade.currentFolder = target.parentElement.children[1].innerHTML.trim();} + document.getElementById('ctx-decompress').style.display = 'block'; + } else { + document.getElementById('ctx-decompress').style.display = 'none'; + } ctx.style.left = `${Math.min(e.pageX, (window.innerWidth - (ctx.clientWidth + 2)))}px`; ctx.style.top = `${Math.min(e.pageY, ((window.innerHeight + window.scrollY) - (ctx.clientHeight + 2)))}px`; }; \ No newline at end of file