Skip to content

Commit

Permalink
Close window on esc
Browse files Browse the repository at this point in the history
  • Loading branch information
tma02 committed Mar 18, 2016
1 parent 4dd966b commit dffab7a
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion lib/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
require('ipc').on('coverUrl', function(url) {
document.getElementById('background').src = url;
document.getElementById('cover').src = url;
});
});
document.onkeydown = function(e) {
e = e || window.event;
if (e.keyCode == 27) {
require('remote').getCurrentWindow().close();
}
};

0 comments on commit dffab7a

Please sign in to comment.