]> source.dussan.org Git - jquery-ui.git/commitdiff
widget: Updating code for show/hide to use new effects API namespace - DRY'ed out... 194/head
authorgnarf <gnarf@gnarf.net>
Mon, 2 May 2011 11:49:59 +0000 (06:49 -0500)
committergnarf <gnarf@gnarf.net>
Mon, 2 May 2011 11:49:59 +0000 (06:49 -0500)
ui/jquery.ui.widget.js

index 65a9f1ce4cc2ae1e47e0c3fe79ae09ff9ad427fd..6a9bd36412c6bc363c1ae4ed96e9be46ab8598c4 100644 (file)
@@ -365,19 +365,10 @@ $.each( { show: "fadeIn", hide: "fadeOut" }, function( method, defaultEffect ) {
                if (options.delay) {
                        element.delay( options.delay );
                }
-               if ( hasOptions && $.effects && $.effects[ effectName ] ) {
+               if ( hasOptions && $.effects && $.effects.effect[ effectName ] ) {
                        element[ method ]( options );
-               } else if ( element[ effectName ] ) {
-                       if ( /show|hide/.test( effectName ) ) {
-                               element.queue( function() {
-                                       element[ effectName ]();
-                                       if ( callback ) {
-                                               callback.call( element[ 0 ] );
-                                       }
-                               });
-                       } else {
-                               element[ effectName ]( options.duration, options.easing, callback );
-                       }
+               } else if ( effectName !== method && element[ effectName ] ) {
+                       element[ effectName ]( options.duration, options.easing, callback );
                } else {
                        element.queue( function() {
                                $( this )[ method ]();