aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorScott González <scott.gonzalez@gmail.com>2008-08-27 00:25:32 +0000
committerScott González <scott.gonzalez@gmail.com>2008-08-27 00:25:32 +0000
commitb5b364ebc2d6c82b6ad0d10ca6ded351cb6fc841 (patch)
tree5b20189ec8e322d77186681402212f703c65723d
parentfa14a0a83c29782787590368b5f571b3c4343ecd (diff)
downloadjquery-ui-b5b364ebc2d6c82b6ad0d10ca6ded351cb6fc841.tar.gz
jquery-ui-b5b364ebc2d6c82b6ad0d10ca6ded351cb6fc841.zip
Dialog: Fixed #3253: Don't allow closing modal dialogs on escape if closeOnEscape is set to false.
-rw-r--r--ui/ui.dialog.js8
1 files changed, 4 insertions, 4 deletions
diff --git a/ui/ui.dialog.js b/ui/ui.dialog.js
index 13b69a7fb..426b04569 100644
--- a/ui/ui.dialog.js
+++ b/ui/ui.dialog.js
@@ -76,9 +76,8 @@ $.widget("ui.dialog", {
// setting tabIndex makes the div focusable
// setting outline to 0 prevents a border on focus in Mozilla
.attr('tabIndex', -1).css('outline', 0).keydown(function(ev) {
- if (options.closeOnEscape) {
- (ev.keyCode && ev.keyCode == $.keyCode.ESCAPE && self.close());
- }
+ (options.closeOnEscape && ev.keyCode
+ && ev.keyCode == $.keyCode.ESCAPE && self.close());
})
.mousedown(function() {
self._moveToTop();
@@ -398,7 +397,8 @@ $.extend($.ui.dialog.overlay, {
// allow closing by pressing the escape key
$(document).bind('keydown.dialog-overlay', function(e) {
- (e.keyCode && e.keyCode == $.keyCode.ESCAPE && dialog.close());
+ (dialog.options.closeOnEscape && e.keyCode
+ && e.keyCode == $.keyCode.ESCAPE && dialog.close());
});
// handle window resize