]> source.dussan.org Git - jquery-ui.git/commitdiff
Dialog: Use _show and _hide consistently. Fixes #4892 - Dialog: zIndex error with... 787/head
authorJörn Zaefferer <joern.zaefferer@gmail.com>
Tue, 23 Oct 2012 15:09:04 +0000 (11:09 -0400)
committerJörn Zaefferer <joern.zaefferer@gmail.com>
Wed, 24 Oct 2012 21:03:00 +0000 (17:03 -0400)
demos/dialog/animated.html
ui/jquery.ui.dialog.js

index 8a27150de0906279547720a12a522198e48e1fa4..808d0e926ca1fe2d38e2b9f6c09c66aa44a0ac15 100644 (file)
        <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>
index 95b3d28a625c9077b13e1945de6ca969a3f7f9fe..4188a38c01a437557ba356c67ffe911c8ad85274 100644 (file)
@@ -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() {
@@ -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