Fix double destroy on escape.

This commit is contained in:
Thomas Tanghus 2013-09-11 17:13:39 +02:00
parent fdfdd2e4e7
commit 7a2b23a036
1 changed files with 2 additions and 1 deletions

View File

@ -39,7 +39,8 @@
return;
}
// Escape
if(event.keyCode === 27 && self.options.closeOnEscape) {
if(event.keyCode === 27 && event.type === 'keydown' && self.options.closeOnEscape) {
event.stopImmediatePropagation();
self.close();
return false;
}