Skip to content

Commit

Permalink
fix bug with escapeClose option
Browse files Browse the repository at this point in the history
  • Loading branch information
elidupuis committed Oct 25, 2011
1 parent c56fe3e commit d83677c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion jquery.modal.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
opacity: options.opacity
});
if(options.escapeClose) {
$(document).keydown(function(event) {
$(document).bind('keydown.modal', function(event) {
if(event.which == 27) {$.fn.modal.close();}
});
}
Expand Down Expand Up @@ -91,6 +91,8 @@
current_modal.elm.hide();
current_modal.elm.trigger($.fn.modal.CLOSE, [current_modal]);
current_modal = null;

$(document).unbind('keydown.modal');
};

$.fn.modal.resize = function() {
Expand Down

0 comments on commit d83677c

Please sign in to comment.