From c9fb4528673f94a3aa338d113b9ebb72f346b900 Mon Sep 17 00:00:00 2001 From: gnarf Date: Mon, 2 May 2011 06:49:59 -0500 Subject: [PATCH] widget: Updating code for show/hide to use new effects API namespace - DRY'ed out a bit as well --- ui/jquery.ui.widget.js | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/ui/jquery.ui.widget.js b/ui/jquery.ui.widget.js index 65a9f1ce4..6a9bd3641 100644 --- a/ui/jquery.ui.widget.js +++ b/ui/jquery.ui.widget.js @@ -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 ](); -- 2.39.5