Make Esc in PDF recognizer window close rather than minimize if done

This commit is contained in:
Dan Stillman 2018-02-23 02:38:01 -05:00
parent 7c64666167
commit 5ed10c6ba2

View file

@ -135,7 +135,13 @@ let Zotero_RecognizePDF_Dialog = new function () {
}, false);
_progressWindow.addEventListener('keypress', function (e) {
if (e.keyCode === KeyEvent.DOM_VK_ESCAPE) close();
if (e.keyCode === KeyEvent.DOM_VK_ESCAPE) {
// If done processing, Esc is equivalent to Close rather than Minimize
if (Zotero.RecognizePDF.getTotal() == Zotero.RecognizePDF.getProcessedTotal()) {
Zotero.RecognizePDF.cancel();
}
close();
}
});
_progressWindow.addEventListener('close', close.bind(this), false);