diff options
author | Scott González <scott.gonzalez@gmail.com> | 2009-02-17 01:20:50 +0000 |
---|---|---|
committer | Scott González <scott.gonzalez@gmail.com> | 2009-02-17 01:20:50 +0000 |
commit | 6754eaa33802e1c22269b827c91acf19c670f9ca (patch) | |
tree | 0c8c24dd457d0a504bf4e7c5ab47a3bb14c9ab27 /ui | |
parent | 49b76873ad4c46fe2c1636b0ad711b147b34e8b8 (diff) | |
download | jquery-ui-6754eaa33802e1c22269b827c91acf19c670f9ca.tar.gz jquery-ui-6754eaa33802e1c22269b827c91acf19c670f9ca.zip |
Cleaned up transfer effect. Despite the huge diff, I didn't change any logic and barely changed any actual code.
Diffstat (limited to 'ui')
-rw-r--r-- | ui/effects.transfer.js | 64 |
1 files changed, 25 insertions, 39 deletions
diff --git a/ui/effects.transfer.js b/ui/effects.transfer.js index 8a627a96b..49105ac17 100644 --- a/ui/effects.transfer.js +++ b/ui/effects.transfer.js @@ -13,47 +13,33 @@ (function($) { $.effects.transfer = function(o) { - return this.queue(function() { - - // Create element - var el = $(this); - - // Set options - var mode = $.effects.setMode(el, o.options.mode || 'effect'); // Set Mode - var target = $(o.options.to); // Find Target - var position = el.offset(); - var transfer = $('<div class="ui-effects-transfer"></div>').appendTo(document.body); - if(o.options.className) transfer.addClass(o.options.className); - - // Set target css - transfer.addClass(o.options.className); - transfer.css({ - top: position.top, - left: position.left, - height: el.innerHeight(), - width: el.innerWidth(), - position: 'absolute' - }); - - // Animation - position = target.offset(); - animation = { - top: position.top, - left: position.left, - height: target.innerHeight(), - width: target.innerWidth() - }; - - // Animate - transfer.animate(animation, o.duration, o.options.easing, function() { - transfer.remove(); // Remove div - if(o.callback) o.callback.apply(el[0], arguments); // Callback - el.dequeue(); - }); - + var elem = $(this), + target = $(o.options.to), + endPosition = target.offset(), + animation = { + top: endPosition.top, + left: endPosition.left, + height: target.innerHeight(), + width: target.innerWidth() + }, + startPosition = elem.offset(), + transfer = $('<div class="ui-effects-transfer"></div>') + .appendTo(document.body) + .addClass(o.options.className) + .css({ + top: startPosition.top, + left: startPosition.left, + height: elem.innerHeight(), + width: elem.innerWidth(), + position: 'absolute' + }) + .animate(animation, o.duration, o.options.easing, function() { + transfer.remove(); + (o.callback && o.callback.apply(elem[0], arguments)); + elem.dequeue(); + }); }); - }; })(jQuery); |