enter + esc keybinds for newfolder modal

toast
Kit Kasune 3 years ago
parent 2bd5e5c2f3
commit 46cff574aa
  1. 9
      scripts/contextmenu/newfolder.js

@ -1,5 +1,6 @@
const fs = require('fs'); const fs = require('fs');
const path = require('path'); const path = require('path');
const mousetrap = require('../dep/mousetrap');
const lightRefresh = require('../fileview/lightrefresh'); const lightRefresh = require('../fileview/lightrefresh');
const preModal = require('../modal/pre'); const preModal = require('../modal/pre');
@ -56,4 +57,12 @@ module.exports = () => {
} }
}; };
cont.appendChild(conf); cont.appendChild(conf);
input.focus();
let msm = new mousetrap(modal);
msm.bind('esc', () => {
lightRefresh();
modal.remove();
postModal(modal.id);
});
msm.bind('enter', () => {conf.click();});
} }
Loading…
Cancel
Save