widget: Updating code for show/hide to use new effects API namespace - DRY'ed out a bit as well

This commit is contained in:
gnarf 2011-05-02 06:49:59 -05:00
parent 56a1b18246
commit c9fb452867

View 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 ]();