Skip to content

Commit 324d3ea

Browse files
committed
mend
1 parent 5cae674 commit 324d3ea

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

ui/jquery.ui.dialog.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -702,6 +702,11 @@ $.extend($.ui.dialog.overlay, {
702702
if (dialog.options.closeOnEscape && event.keyCode &&
703703
event.keyCode === $.ui.keyCode.ESCAPE ) {
704704

705+
// find the 'top' overlay (by zIndex) and close its dialog
706+
// Note: it's best to do this search here when we know we need it.
707+
// Caching the top overlay at any point (like in dialog.moveToTop) is no better
708+
// and if the dialog is closed my a mechanism other than the ESCAPE key on the overlay
709+
// we would never use the cache.
705710
$.grep(self.instances, function(instance){
706711
return instance.zIndex() == $.ui.dialog.overlay.maxZ;
707712
})[0].dialog.close(event);

0 commit comments

Comments
 (0)