aboutsummaryrefslogtreecommitdiffstats
path: root/ui/jquery.effects.drop.js
diff options
context:
space:
mode:
authorScott González <scott.gonzalez@gmail.com>2011-07-25 11:53:14 -0400
committerScott González <scott.gonzalez@gmail.com>2011-07-25 11:53:14 -0400
commit19a9de7e668cdb3b76c3b733d0147f1853cb38a5 (patch)
treea259b421dd77cbec27e55db9b4d1104bf5214a2a /ui/jquery.effects.drop.js
parentdaadc343be2f139e82719e2e5ff466aa19ec166f (diff)
parent51ee3be39829e339c8e4bccb532347944e600ca5 (diff)
downloadjquery-ui-19a9de7e668cdb3b76c3b733d0147f1853cb38a5.tar.gz
jquery-ui-19a9de7e668cdb3b76c3b733d0147f1853cb38a5.zip
Merge branch 'master' into core-1.6.1
Conflicts: demos/menubar/default.html tests/unit/autocomplete/autocomplete.html tests/visual/effects/effects.all.html ui/jquery.ui.menu.js ui/jquery.ui.popup.js
Diffstat (limited to 'ui/jquery.effects.drop.js')
-rw-r--r--ui/jquery.effects.drop.js87
1 files changed, 43 insertions, 44 deletions
diff --git a/ui/jquery.effects.drop.js b/ui/jquery.effects.drop.js
index 24fb89db0..2e7a6ec0f 100644
--- a/ui/jquery.effects.drop.js
+++ b/ui/jquery.effects.drop.js
@@ -12,51 +12,50 @@
*/
(function( $, undefined ) {
-$.effects.effect.drop = function( o ) {
-
- return this.queue( function() {
-
- var el = $( this ),
- props = [ 'position', 'top', 'bottom', 'left', 'right', 'opacity' ],
- mode = $.effects.setMode( el, o.mode || 'hide' ),
- direction = o.direction || 'left',
- ref = ( direction == 'up' || direction == 'down' ) ? 'top' : 'left',
- motion = ( direction == 'up' || direction == 'left' ) ? 'pos' : 'neg',
- animation = {
- opacity: mode == 'show' ? 1 : 0
- },
- distance;
-
- // Adjust
- $.effects.save( el, props );
- el.show();
- $.effects.createWrapper( el );
-
- distance = o.distance || el[ ref == 'top' ? 'outerHeight': 'outerWidth' ]({ margin: true }) / 2;
-
- if ( mode == 'show' ) {
- el
- .css( 'opacity', 0 )
- .css( ref, motion == 'pos' ? -distance : distance );
+$.effects.effect.drop = function( o, done ) {
+
+ var el = $( this ),
+ props = [ "position", "top", "bottom", "left", "right", "opacity", "height", "width" ],
+ mode = $.effects.setMode( el, o.mode || "hide" ),
+ show = mode === "show",
+ direction = o.direction || "left",
+ ref = ( direction === "up" || direction === "down" ) ? "top" : "left",
+ motion = ( direction === "up" || direction === "left" ) ? "pos" : "neg",
+ animation = {
+ opacity: show ? 1 : 0
+ },
+ distance;
+
+ // Adjust
+ $.effects.save( el, props );
+ el.show();
+ $.effects.createWrapper( el );
+
+ distance = o.distance || el[ ref == "top" ? "outerHeight": "outerWidth" ]({ margin: true }) / 2;
+
+ if ( show ) {
+ el
+ .css( "opacity", 0 )
+ .css( ref, motion == "pos" ? -distance : distance );
+ }
+
+ // Animation
+ animation[ ref ] = ( show ?
+ ( motion === "pos" ? "+=" : "-=" ) :
+ ( motion === "pos" ? "-=" : "+=" ) )
+ + distance;
+
+ // Animate
+ el.animate( animation, {
+ queue: false,
+ duration: o.duration,
+ easing: o.easing,
+ complete: function() {
+ mode == "hide" && el.hide();
+ $.effects.restore( el, props );
+ $.effects.removeWrapper( el );
+ done();
}
-
- // Animation
- animation[ ref ] = ((mode == 'show') ? (motion == 'pos' ? '+=' : '-=') : (motion == 'pos' ? '-=' : '+=')) + distance;
-
- // Animate
- el.animate( animation, {
- queue: false,
- duration: o.duration,
- easing: o.easing,
- complete: function() {
- mode == 'hide' && el.hide();
- $.effects.restore( el, props );
- $.effects.removeWrapper( el );
- $.isFunction( o.complete ) && o.complete.apply(this, arguments);
- el.dequeue();
- }
- });
-
});
};