diff options
author | gnarf <gnarf@gnarf.net> | 2011-05-02 06:49:59 -0500 |
---|---|---|
committer | gnarf <gnarf@gnarf.net> | 2011-05-02 06:49:59 -0500 |
commit | c9fb4528673f94a3aa338d113b9ebb72f346b900 (patch) | |
tree | 83729a82deb187bb7450cbc815ec85d3c3f4253e /ui/jquery.ui.widget.js | |
parent | 56a1b182462ef222cc307a8a81c0fc5226741f87 (diff) | |
download | jquery-ui-c9fb4528673f94a3aa338d113b9ebb72f346b900.tar.gz jquery-ui-c9fb4528673f94a3aa338d113b9ebb72f346b900.zip |
widget: Updating code for show/hide to use new effects API namespace - DRY'ed out a bit as well
Diffstat (limited to 'ui/jquery.ui.widget.js')
-rw-r--r-- | ui/jquery.ui.widget.js | 15 |
1 files 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 ](); |