From 46cff574aa71672e38799c9805bd0371ff61aaac Mon Sep 17 00:00:00 2001 From: WubzyGD Date: Sat, 11 Dec 2021 12:46:24 -0700 Subject: [PATCH] enter + esc keybinds for newfolder modal --- scripts/contextmenu/newfolder.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/scripts/contextmenu/newfolder.js b/scripts/contextmenu/newfolder.js index d0a9800..5786e70 100644 --- a/scripts/contextmenu/newfolder.js +++ b/scripts/contextmenu/newfolder.js @@ -1,5 +1,6 @@ const fs = require('fs'); const path = require('path'); +const mousetrap = require('../dep/mousetrap'); const lightRefresh = require('../fileview/lightrefresh'); const preModal = require('../modal/pre'); @@ -56,4 +57,12 @@ module.exports = () => { } }; cont.appendChild(conf); + input.focus(); + let msm = new mousetrap(modal); + msm.bind('esc', () => { + lightRefresh(); + modal.remove(); + postModal(modal.id); + }); + msm.bind('enter', () => {conf.click();}); } \ No newline at end of file