mirror of
https://github.com/jquery/jquery-ui.git
synced 2025-01-07 20:34:24 +00:00
dialog: $.keyCode
This commit is contained in:
parent
293d6bc595
commit
54dc4e2cd4
@ -77,8 +77,7 @@ $.widget("ui.dialog", {
|
|||||||
// setting outline to 0 prevents a border on focus in Mozilla
|
// setting outline to 0 prevents a border on focus in Mozilla
|
||||||
.attr('tabIndex', -1).css('outline', 0).keydown(function(ev) {
|
.attr('tabIndex', -1).css('outline', 0).keydown(function(ev) {
|
||||||
if (options.closeOnEscape) {
|
if (options.closeOnEscape) {
|
||||||
var ESC = 27;
|
(ev.keyCode && ev.keyCode == $.keyCode.ESCAPE && self.close());
|
||||||
(ev.keyCode && ev.keyCode == ESC && self.close());
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.mousedown(function() {
|
.mousedown(function() {
|
||||||
@ -399,8 +398,7 @@ $.extend($.ui.dialog.overlay, {
|
|||||||
|
|
||||||
// allow closing by pressing the escape key
|
// allow closing by pressing the escape key
|
||||||
$(document).bind('keydown.dialog-overlay', function(e) {
|
$(document).bind('keydown.dialog-overlay', function(e) {
|
||||||
var ESC = 27;
|
(e.keyCode && e.keyCode == $.keyCode.ESCAPE && dialog.close());
|
||||||
(e.keyCode && e.keyCode == ESC && dialog.close());
|
|
||||||
});
|
});
|
||||||
|
|
||||||
// handle window resize
|
// handle window resize
|
||||||
|
Loading…
Reference in New Issue
Block a user