Skip to content

Commit

Permalink
Dialog: Use _show and _hide consistently. Fixes #4892 - Dialog: zInde…
Browse files Browse the repository at this point in the history
…x error with animated modal dialog.
  • Loading branch information
jzaefferer committed Oct 24, 2012
1 parent 513b6da commit d07074d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 15 deletions.
13 changes: 8 additions & 5 deletions demos/dialog/animated.html
Expand Up @@ -18,18 +18,21 @@
<script src="../../ui/jquery.ui.effect-explode.js"></script>
<link rel="stylesheet" href="../demos.css">
<script>
// increase the default animation speed to exaggerate the effect
$.fx.speeds._default = 1000;
$(function() {
$( "#dialog" ).dialog({
autoOpen: false,
show: "blind",
hide: "explode"
show: {
effect: "blind",
duration: 1000
},
hide: {
effect: "explode",
duration: 1000
}
});

$( "#opener" ).click(function() {
$( "#dialog" ).dialog( "open" );
return false;
});
});
</script>
Expand Down
14 changes: 4 additions & 10 deletions ui/jquery.ui.dialog.js
Expand Up @@ -255,14 +255,9 @@ $.widget("ui.dialog", {
$( this.document[ 0 ].activeElement ).blur();
}

if ( this.options.hide ) {
this._hide( this.uiDialog, this.options.hide, function() {
that._trigger( "close", event );
});
} else {
this.uiDialog.hide();
this._trigger( "close", event );
}
this._hide( this.uiDialog, this.options.hide, function() {
that._trigger( "close", event );
});
},

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

this._size();
this._position( options.position );
uiDialog.show( options.show );
this.overlay = options.modal ? new $.ui.dialog.overlay( this ) : null;

this.moveToTop( null, true );
this._show( uiDialog, options.show );

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

0 comments on commit d07074d

Please sign in to comment.