Add missing commonDialog.js from dictionary manager
Currently provides close-on-Esc functionality
This commit is contained in:
parent
bbdcb92042
commit
3743c179e1
1 changed files with 14 additions and 0 deletions
14
chrome/content/zotero/commonDialog.js
Normal file
14
chrome/content/zotero/commonDialog.js
Normal 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();
|
||||
}
|
||||
}
|
||||
});
|
Loading…
Reference in a new issue