From aff2356efcc381da7276e055dba536a7515a4abd Mon Sep 17 00:00:00 2001 From: WubzyGD Date: Tue, 19 Apr 2022 13:32:37 -0600 Subject: [PATCH] invisible input to prevent repeated deletion --- scripts/contextmenu/delete-folder.js | 7 ++++++- styles/styles.css | 12 +++++++++++- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/scripts/contextmenu/delete-folder.js b/scripts/contextmenu/delete-folder.js index 46b18b3..2be00e7 100644 --- a/scripts/contextmenu/delete-folder.js +++ b/scripts/contextmenu/delete-folder.js @@ -53,7 +53,12 @@ module.exports = () => { }; cont.appendChild(conf); cont.appendChild(cxl); - let msm = new Mousetrap(); + let iin = document.createElement('input'); + iin.className = 'invis'; + iin.classList.add('nosel'); + cont.appendChild(iin); + iin.focus(); + let msm = new Mousetrap(modal); msm.bind('esc', () => { lightRefresh(); modalOut.remove(); diff --git a/styles/styles.css b/styles/styles.css index 73b2a1a..dba6f3d 100755 --- a/styles/styles.css +++ b/styles/styles.css @@ -109,4 +109,14 @@ body { background-image: linear-gradient(to bottom, #af2188c5 0%, #af2188c5 10%, #fa59cfc5 75%, #fa59cfc5 100%); } -::-webkit-scrollbar-thumb:hover {background-image: linear-gradient(to bottom, #af2188ff 0%, #af2188ff 10%, #fa59cfff 75%, #fa59cfff 100%);} \ No newline at end of file +::-webkit-scrollbar-thumb:hover {background-image: linear-gradient(to bottom, #af2188ff 0%, #af2188ff 10%, #fa59cfff 75%, #fa59cfff 100%);} + +.invis { + position: relative; + left: -1000px; + width: 0; + height: 0; + padding: 0 0; + margin: 0 0; + opacity: 0; +} \ No newline at end of file