Add missing commonDialog.js from dictionary manager

Currently provides close-on-Esc functionality
This commit is contained in:
Dan Stillman 2022-06-21 01:23:22 -04:00
parent bbdcb92042
commit 3743c179e1

View file

@ -0,0 +1,14 @@
window.addEventListener('keypress', function (event) {
if (event.key == 'Escape') {
try {
let elem = document.querySelector('button[dlgtype="cancel"]');
if (!elem) {
elem = document.getElementById('cancel-button');
}
elem.click();
}
catch (e) {
window.close();
}
}
});