aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChi Cheng <cloudream@gmail.com>2008-08-24 15:42:03 +0000
committerChi Cheng <cloudream@gmail.com>2008-08-24 15:42:03 +0000
commit54dc4e2cd48911d7f559bed77ab864300d444e97 (patch)
treeaa0d4bf33b97e8c52fc94e27aee5fdbada857d46
parent293d6bc595be3848386f4d4f9fa702141ff61d8b (diff)
downloadjquery-ui-54dc4e2cd48911d7f559bed77ab864300d444e97.tar.gz
jquery-ui-54dc4e2cd48911d7f559bed77ab864300d444e97.zip
dialog: $.keyCode
-rw-r--r--ui/ui.dialog.js6
1 files changed, 2 insertions, 4 deletions
diff --git a/ui/ui.dialog.js b/ui/ui.dialog.js
index c50229c6d..b8f908487 100644
--- a/ui/ui.dialog.js
+++ b/ui/ui.dialog.js
@@ -77,8 +77,7 @@ $.widget("ui.dialog", {
// setting outline to 0 prevents a border on focus in Mozilla
.attr('tabIndex', -1).css('outline', 0).keydown(function(ev) {
if (options.closeOnEscape) {
- var ESC = 27;
- (ev.keyCode && ev.keyCode == ESC && self.close());
+ (ev.keyCode && ev.keyCode == $.keyCode.ESCAPE && self.close());
}
})
.mousedown(function() {
@@ -399,8 +398,7 @@ $.extend($.ui.dialog.overlay, {
// allow closing by pressing the escape key
$(document).bind('keydown.dialog-overlay', function(e) {
- var ESC = 27;
- (e.keyCode && e.keyCode == ESC && dialog.close());
+ (e.keyCode && e.keyCode == $.keyCode.ESCAPE && dialog.close());
});
// handle window resize