aboutsummaryrefslogtreecommitdiffstats
path: root/ui/jquery.effects.transfer.js
diff options
context:
space:
mode:
authorgnarf <gnarf@gnarf.net>2011-06-21 00:23:52 -0500
committergnarf <gnarf@gnarf.net>2011-06-21 01:18:01 -0500
commit1c1a3b1a361d90a73755fbd038b3cdfb0960c29f (patch)
treef86c98826a6c72421c9bc20b4e75855598bebf34 /ui/jquery.effects.transfer.js
parentfb210ae1ec16cefb1e4d4dfaf7d55499cac53ab8 (diff)
downloadjquery-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.transfer.js')
-rw-r--r--ui/jquery.effects.transfer.js63
1 files changed, 30 insertions, 33 deletions
diff --git a/ui/jquery.effects.transfer.js b/ui/jquery.effects.transfer.js
index f0f9d9fd4..061882fec 100644
--- a/ui/jquery.effects.transfer.js
+++ b/ui/jquery.effects.transfer.js
@@ -12,39 +12,36 @@
*/
(function( $, undefined ) {
-$.effects.effect.transfer = function( o ) {
-
- return this.queue( function() {
- var elem = $( this ),
- target = $( o.to ),
- targetFixed = target.css( "position" ) === "fixed",
- body = $("body"),
- fixTop = targetFixed ? body.scrollTop() : 0,
- fixLeft = targetFixed ? body.scrollLeft() : 0,
- endPosition = target.offset(),
- animation = {
- top: endPosition.top - fixTop ,
- left: endPosition.left - fixLeft ,
- height: target.innerHeight(),
- width: target.innerWidth()
- },
- startPosition = elem.offset(),
- transfer = $( '<div class="ui-effects-transfer"></div>' )
- .appendTo( document.body )
- .addClass( o.className )
- .css({
- top: startPosition.top - fixTop ,
- left: startPosition.left - fixLeft ,
- height: elem.innerHeight(),
- width: elem.innerWidth(),
- position: targetFixed ? "fixed" : "absolute"
- })
- .animate( animation, o.duration, o.easing, function() {
- transfer.remove();
- $.isFunction( o.complete ) && o.complete.apply(elem[0], arguments);
- elem.dequeue();
- });
- });
+$.effects.effect.transfer = function( o, next ) {
+ var elem = $( this ),
+ target = $( o.to ),
+ targetFixed = target.css( "position" ) === "fixed",
+ body = $("body"),
+ fixTop = targetFixed ? body.scrollTop() : 0,
+ fixLeft = targetFixed ? body.scrollLeft() : 0,
+ endPosition = target.offset(),
+ animation = {
+ top: endPosition.top - fixTop ,
+ left: endPosition.left - fixLeft ,
+ height: target.innerHeight(),
+ width: target.innerWidth()
+ },
+ startPosition = elem.offset(),
+ transfer = $( '<div class="ui-effects-transfer"></div>' )
+ .appendTo( document.body )
+ .addClass( o.className )
+ .css({
+ top: startPosition.top - fixTop ,
+ left: startPosition.left - fixLeft ,
+ height: elem.innerHeight(),
+ width: elem.innerWidth(),
+ position: targetFixed ? "fixed" : "absolute"
+ })
+ .animate( animation, o.duration, o.easing, function() {
+ transfer.remove();
+ $.isFunction( o.complete ) && o.complete.apply(elem[0], arguments);
+ next();
+ });
};
})(jQuery);