]> source.dussan.org Git - jquery-ui.git/commitdiff
Effects (fade): Delegate hiding and showing to core. Fixes #8267 - dialog fadein...
authorScott González <scott.gonzalez@gmail.com>
Fri, 15 Jun 2012 01:01:14 +0000 (21:01 -0400)
committerScott González <scott.gonzalez@gmail.com>
Fri, 15 Jun 2012 11:35:08 +0000 (07:35 -0400)
ui/jquery.effects.fade.js

index 66029b51c4cf0f025cb1b7f7a7acb9a2c813a700..3989ee908ada569a02b8fb2c24287a3a0f7f1980 100644 (file)
 
 $.effects.effect.fade = function( o, done ) {
        var el = $( this ),
-               mode = $.effects.setMode( el, o.mode || "toggle" ),
-               hide = mode === "hide";
+               mode = $.effects.setMode( el, o.mode || "toggle" );
 
-       el.show();
        el.animate({
-               opacity: hide ? 0 : 1
+               opacity: mode
        }, {
                queue: false,
                duration: o.duration,
                easing: o.easing,
-               complete: function() {
-                       if ( hide ) {
-                               el.hide();
-                       }
-                       done();
-               }
+               complete: done
        });
 };
 
-})(jQuery);
+})( jQuery );