mirror of
https://github.com/jquery/jquery-ui.git
synced 2025-01-07 20:34:24 +00:00
Dialog: Use _show and _hide consistently. Fixes #4892 - Dialog: zIndex error with animated modal dialog.
This commit is contained in:
parent
513b6da641
commit
d07074dc3c
@ -18,18 +18,21 @@
|
|||||||
<script src="../../ui/jquery.ui.effect-explode.js"></script>
|
<script src="../../ui/jquery.ui.effect-explode.js"></script>
|
||||||
<link rel="stylesheet" href="../demos.css">
|
<link rel="stylesheet" href="../demos.css">
|
||||||
<script>
|
<script>
|
||||||
// increase the default animation speed to exaggerate the effect
|
|
||||||
$.fx.speeds._default = 1000;
|
|
||||||
$(function() {
|
$(function() {
|
||||||
$( "#dialog" ).dialog({
|
$( "#dialog" ).dialog({
|
||||||
autoOpen: false,
|
autoOpen: false,
|
||||||
show: "blind",
|
show: {
|
||||||
hide: "explode"
|
effect: "blind",
|
||||||
|
duration: 1000
|
||||||
|
},
|
||||||
|
hide: {
|
||||||
|
effect: "explode",
|
||||||
|
duration: 1000
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
$( "#opener" ).click(function() {
|
$( "#opener" ).click(function() {
|
||||||
$( "#dialog" ).dialog( "open" );
|
$( "#dialog" ).dialog( "open" );
|
||||||
return false;
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
14
ui/jquery.ui.dialog.js
vendored
14
ui/jquery.ui.dialog.js
vendored
@ -255,14 +255,9 @@ $.widget("ui.dialog", {
|
|||||||
$( this.document[ 0 ].activeElement ).blur();
|
$( this.document[ 0 ].activeElement ).blur();
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( this.options.hide ) {
|
this._hide( this.uiDialog, this.options.hide, function() {
|
||||||
this._hide( this.uiDialog, this.options.hide, function() {
|
that._trigger( "close", event );
|
||||||
that._trigger( "close", event );
|
});
|
||||||
});
|
|
||||||
} else {
|
|
||||||
this.uiDialog.hide();
|
|
||||||
this._trigger( "close", event );
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
|
|
||||||
isOpen: function() {
|
isOpen: function() {
|
||||||
@ -289,10 +284,9 @@ $.widget("ui.dialog", {
|
|||||||
|
|
||||||
this._size();
|
this._size();
|
||||||
this._position( options.position );
|
this._position( options.position );
|
||||||
uiDialog.show( options.show );
|
|
||||||
this.overlay = options.modal ? new $.ui.dialog.overlay( this ) : null;
|
this.overlay = options.modal ? new $.ui.dialog.overlay( this ) : null;
|
||||||
|
|
||||||
this.moveToTop( null, true );
|
this.moveToTop( null, true );
|
||||||
|
this._show( uiDialog, options.show );
|
||||||
|
|
||||||
// set focus to the first tabbable element in the content area or the first button
|
// 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
|
// if there are no tabbable elements, set focus on the dialog itself
|
||||||
|
Loading…
Reference in New Issue
Block a user