Skip to content

Commit d07074d

Browse files
committed
Dialog: Use _show and _hide consistently. Fixes #4892 - Dialog: zIndex error with animated modal dialog.
1 parent 513b6da commit d07074d

File tree

2 files changed

+12
-15
lines changed

2 files changed

+12
-15
lines changed

demos/dialog/animated.html

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,18 +18,21 @@
1818
<script src="../../ui/jquery.ui.effect-explode.js"></script>
1919
<link rel="stylesheet" href="../demos.css">
2020
<script>
21-
// increase the default animation speed to exaggerate the effect
22-
$.fx.speeds._default = 1000;
2321
$(function() {
2422
$( "#dialog" ).dialog({
2523
autoOpen: false,
26-
show: "blind",
27-
hide: "explode"
24+
show: {
25+
effect: "blind",
26+
duration: 1000
27+
},
28+
hide: {
29+
effect: "explode",
30+
duration: 1000
31+
}
2832
});
2933

3034
$( "#opener" ).click(function() {
3135
$( "#dialog" ).dialog( "open" );
32-
return false;
3336
});
3437
});
3538
</script>

ui/jquery.ui.dialog.js

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -255,14 +255,9 @@ $.widget("ui.dialog", {
255255
$( this.document[ 0 ].activeElement ).blur();
256256
}
257257

258-
if ( this.options.hide ) {
259-
this._hide( this.uiDialog, this.options.hide, function() {
260-
that._trigger( "close", event );
261-
});
262-
} else {
263-
this.uiDialog.hide();
264-
this._trigger( "close", event );
265-
}
258+
this._hide( this.uiDialog, this.options.hide, function() {
259+
that._trigger( "close", event );
260+
});
266261
},
267262

268263
isOpen: function() {
@@ -289,10 +284,9 @@ $.widget("ui.dialog", {
289284

290285
this._size();
291286
this._position( options.position );
292-
uiDialog.show( options.show );
293287
this.overlay = options.modal ? new $.ui.dialog.overlay( this ) : null;
294-
295288
this.moveToTop( null, true );
289+
this._show( uiDialog, options.show );
296290

297291
// set focus to the first tabbable element in the content area or the first button
298292
// if there are no tabbable elements, set focus on the dialog itself

0 commit comments

Comments
 (0)