Merge pull request #465 from urkerab/esc-close-popup

Close the popup when the Escape key is pressed
This commit is contained in:
Guangcong Luo
2015-09-09 12:25:59 -05:00

View File

@@ -4,6 +4,14 @@
window.gui = require('nw.gui');
window.nwWindow = gui.Window.get();
}
$(document).on('keydown', function (e) {
if (e.keyCode == 27) {
e.preventDefault();
e.stopPropagation();
e.stopImmediatePropagation();
app.closePopup();
}
});
$(document).on('click', 'a', function (e) {
if (this.className === 'closebutton') return; // handled elsewhere
if (this.className.indexOf('minilogo') >= 0) return; // handled elsewhere