mirror of
https://github.com/smogon/pokemon-showdown-client.git
synced 2026-10-01 23:32:02 -05:00
Merge pull request #465 from urkerab/esc-close-popup
Close the popup when the Escape key is pressed
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user