diff options
author | gnarf <gnarf@gnarf.net> | 2011-06-21 00:23:52 -0500 |
---|---|---|
committer | gnarf <gnarf@gnarf.net> | 2011-06-21 01:18:01 -0500 |
commit | 1c1a3b1a361d90a73755fbd038b3cdfb0960c29f (patch) | |
tree | f86c98826a6c72421c9bc20b4e75855598bebf34 /ui/jquery.effects.fade.js | |
parent | fb210ae1ec16cefb1e4d4dfaf7d55499cac53ab8 (diff) | |
download | jquery-ui-1c1a3b1a361d90a73755fbd038b3cdfb0960c29f.tar.gz jquery-ui-1c1a3b1a361d90a73755fbd038b3cdfb0960c29f.zip |
Effects.*: Updating Effect Method API to avoid duplicating the queue call - Fixes #7318 - Add the queue functions to $.fn.effect()
Diffstat (limited to 'ui/jquery.effects.fade.js')
-rw-r--r-- | ui/jquery.effects.fade.js | 40 |
1 files changed, 19 insertions, 21 deletions
diff --git a/ui/jquery.effects.fade.js b/ui/jquery.effects.fade.js index ff1cba5f8..8f2d956dc 100644 --- a/ui/jquery.effects.fade.js +++ b/ui/jquery.effects.fade.js @@ -12,29 +12,27 @@ */ (function( $, undefined ) { -$.effects.effect.fade = function( o ) { - return this.queue( function( next ) { - var el = $( this ), - mode = $.effects.setMode( el, o.mode || 'toggle' ), - hide = mode === "hide"; +$.effects.effect.fade = function( o, next ) { + var el = $( this ), + mode = $.effects.setMode( el, o.mode || "toggle" ), + hide = mode === "hide"; - el.show(); - el.animate({ - opacity: hide ? 0 : 1 - }, { - queue: false, - duration: o.duration, - easing: o.easing, - complete: function() { - if ( hide ) { - el.hide(); - } - if ( o.complete ) { - o.complete.call( this ); - } - next(); + el.show(); + el.animate({ + opacity: hide ? 0 : 1 + }, { + queue: false, + duration: o.duration, + easing: o.easing, + complete: function() { + if ( hide ) { + el.hide(); } - }); + if ( o.complete ) { + o.complete.call( this ); + } + next(); + } }); }; |