Skip to content

Commit 8bb412d

Browse files
jamiejagscottgonzalez
authored andcommitted
Dialog: Ensure dialogs have a z-index when calculating the max z-index. Fixex #5955 - Dialog: Closing UI dialog when z-index is not defined in any .ui-dialog class, causes NaN to be used as Z-index, throwing an error. Fixes #4652 - Dialog: Event loss in subsequent dialog calls (FF3).
1 parent abfa0e1 commit 8bb412d

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

ui/jquery.ui.dialog.js

+5-2
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ $.widget("ui.dialog", {
228228

229229
close: function(event) {
230230
var self = this,
231-
maxZ;
231+
maxZ, thisZ;
232232

233233
if (false === self._trigger('beforeClose', event)) {
234234
return;
@@ -257,7 +257,10 @@ $.widget("ui.dialog", {
257257
maxZ = 0;
258258
$('.ui-dialog').each(function() {
259259
if (this !== self.uiDialog[0]) {
260-
maxZ = Math.max(maxZ, $(this).css('z-index'));
260+
thisZ = $(this).css('z-index');
261+
if(!isNaN(thisZ)) {
262+
maxZ = Math.max(maxZ, thisZ);
263+
}
261264
}
262265
});
263266
$.ui.dialog.maxZ = maxZ;

0 commit comments

Comments
 (0)