From 54dc4e2cd48911d7f559bed77ab864300d444e97 Mon Sep 17 00:00:00 2001 From: Chi Cheng Date: Sun, 24 Aug 2008 15:42:03 +0000 Subject: dialog: $.keyCode --- ui/ui.dialog.js | 6 ++---- 1 file 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 -- cgit v1.2.3