var rvertical = /up|down|vertical/,
rpositivemotion = /up|left|vertical|horizontal/;
-$.effects.effect.blind = function( o, next ) {
+$.effects.effect.blind = function( o, done ) {
// Create element
var el = $( this ),
props = [ "position", "top", "bottom", "left", "right", "height", "width" ],
}
$.effects.restore( el, props );
$.effects.removeWrapper( el );
- if ( $.isFunction( o.complete ) ) {
- o.complete.apply( el[ 0 ], arguments );
- }
- next();
+ done();
}
});
*/
(function( $, undefined ) {
-$.effects.effect.bounce = function( o, next ) {
+$.effects.effect.bounce = function( o, done ) {
var el = $( this ),
props = [ "position", "top", "bottom", "left", "right", "height", "width" ],
el.animate( upAnim, speed, easing );
}
- el.queue( function( next ) {
+ el.queue(function() {
if ( hide ) {
el.hide();
}
$.effects.restore( el, props );
$.effects.removeWrapper( el );
- if ( o.complete ) {
- o.complete.apply( el[ 0 ] );
- }
- next();
+ done();
});
// inject all the animations we just queued to be first in line (after "inprogress")
queue.splice.apply( queue,
[ 1, 0 ].concat( queue.splice( queuelen, anims + 1 ) ) );
}
- next();
+ el.dequeue();
};
*/
(function( $, undefined ) {
-$.effects.effect.clip = function( o, next ) {
+$.effects.effect.clip = function( o, done ) {
// Create element
var el = $( this ),
props = [ "position", "top", "bottom", "left", "right", "height", "width" ],
}
$.effects.restore( el, props );
$.effects.removeWrapper( el );
- if ( $.isFunction( o.complete ) ) {
- o.complete.apply( el[ 0 ], arguments );
- }
- el.dequeue();
+ done();
}
});
}
function run( next ) {
- effectMethod.call( this, args, $.isFunction( next ) ? next : $.noop );
+ var elem = this,
+ complete = args.complete;
+
+ function done() {
+ if ( $.isFunction( complete ) ) {
+ complete.call( elem );
+ }
+ if ( $.isFunction( next ) ) {
+ next();
+ }
+ }
+
+ effectMethod.call( elem, args, done );
}
// TODO: remove this check in 2.0, effectMethod will always be true
*/
(function( $, undefined ) {
-$.effects.effect.drop = function( o, next ) {
+$.effects.effect.drop = function( o, done ) {
var el = $( this ),
props = [ "position", "top", "bottom", "left", "right", "opacity", "height", "width" ],
mode == "hide" && el.hide();
$.effects.restore( el, props );
$.effects.removeWrapper( el );
- $.isFunction( o.complete ) && o.complete.apply( this, arguments );
- next();
+ done();
}
});
*/
(function( $, undefined ) {
-$.effects.effect.explode = function( o, next ) {
+$.effects.effect.explode = function( o, done ) {
var rows = o.pieces ? Math.round( Math.sqrt( o.pieces ) ) : 3,
cells = rows,
if ( !show ) {
el.hide();
}
- if ( $.isFunction( o.complete ) ) {
- o.complete.apply( el[ 0 ] );
- }
- next();
+ done();
}
};
*/
(function( $, undefined ) {
-$.effects.effect.fade = function( o, next ) {
+$.effects.effect.fade = function( o, done ) {
var el = $( this ),
mode = $.effects.setMode( el, o.mode || "toggle" ),
hide = mode === "hide";
if ( hide ) {
el.hide();
}
- if ( o.complete ) {
- o.complete.call( this );
- }
- next();
+ done();
}
});
};
*/
(function( $, undefined ) {
-$.effects.effect.fold = function( o, next ) {
+$.effects.effect.fold = function( o, done ) {
// Create element
var el = $( this ),
}
$.effects.restore( el, props );
$.effects.removeWrapper( el );
- if ( $.isFunction( o.complete ) ) {
- o.complete.apply( el[ 0 ], arguments );
- }
- next();
+ done();
});
};
*/
(function( $, undefined ) {
-$.effects.effect.highlight = function( o, next ) {
+$.effects.effect.highlight = function( o, done ) {
var elem = $( this ),
props = [ "backgroundImage", "backgroundColor", "opacity" ],
mode = $.effects.setMode( elem, o.mode || "show" ),
elem.hide();
}
$.effects.restore( elem, props );
- if ( $.isFunction( o.complete) ) {
- o.complete.apply( this, arguments );
- }
- next();
+ done();
}
});
};
*/
(function( $, undefined ) {
-$.effects.effect.pulsate = function( o, next ) {
+$.effects.effect.pulsate = function( o, done ) {
var elem = $( this ),
mode = $.effects.setMode( elem, o.mode || "show" ),
show = mode === "show",
opacity: animateTo
}, duration, o.easing);
- elem.queue( function( next ) {
+ elem.queue(function() {
if ( hide ) {
elem.hide();
}
- if ( o.complete ) {
- o.complete.apply( this );
- }
- next();
+ done();
});
// We just queued up "anims" animations, we need to put them next in the queue
queue.splice.apply( queue,
[ 1, 0 ].concat( queue.splice( queuelen, anims + 1 ) ) );
}
- next();
+ elem.dequeue();
};
})(jQuery);
*/
(function( $, undefined ) {
-function compFunction( el, complete, next ) {
- return function() {
- if ( $.isFunction( complete ) ) {
- complete.apply( el );
- }
- next();
- };
-};
-
-$.effects.effect.puff = function( o, next ) {
+$.effects.effect.puff = function( o, done ) {
var elem = $( this ),
mode = $.effects.setMode( elem, o.mode || "hide" ),
hide = mode === "hide",
queue: false,
fade: true,
mode: mode,
- complete: compFunction( this, o.complete, next ),
+ complete: done,
percent: hide ? percent : 100,
from: hide
? original
elem.effect( o );
};
-$.effects.effect.scale = function( o, next ) {
+$.effects.effect.scale = function( o, done ) {
// Create element
var el = $( this ),
// We are going to pass this effect to the size effect:
options.effect = "size";
options.queue = false;
- options.complete = compFunction( this, options.complete, next );
+ options.complete = done;
// Set default origin and restore for show/hide
if ( mode != "effect" ) {
};
-$.effects.effect.size = function( o, next ) {
+$.effects.effect.size = function( o, done ) {
// Create element
var el = $( this ),
}
$.effects.removeWrapper( el );
- if ( $.isFunction( o.complete ) ) {
- o.complete.apply( this, arguments );
- }
- next();
+ done();
}
});
*/
(function( $, undefined ) {
-$.effects.effect.shake = function( o, next ) {
+$.effects.effect.shake = function( o, done ) {
var el = $( this ),
props = [ "position", "top", "bottom", "left", "right", "height", "width" ],
el
.animate( animation1, speed, o.easing )
.animate( animation, speed / 2, o.easing )
- .queue( function( next ) {
+ .queue(function() {
if ( mode === "hide" ) {
el.hide();
}
$.effects.restore( el, props );
$.effects.removeWrapper( el );
- if ( $.isFunction( o.complete ) ) {
- o.complete.apply( this, arguments );
- }
- next();
+ done();
});
// inject all the animations we just queued to be first in line (after "inprogress")
queue.splice.apply( queue,
[ 1, 0 ].concat( queue.splice( queuelen, anims + 1 ) ) );
}
- next();
+ el.dequeue();
};
*/
(function( $, undefined ) {
-$.effects.effect.slide = function( o, next ) {
+$.effects.effect.slide = function( o, done ) {
// Create element
var el = $( this ),
}
$.effects.restore( el, props );
$.effects.removeWrapper( el );
- if ( $.isFunction( o.complete ) ) {
- o.complete.apply( this, arguments );
- }
- next();
+ done();
}
});
*/
(function( $, undefined ) {
-$.effects.effect.transfer = function( o, next ) {
+$.effects.effect.transfer = function( o, done ) {
var elem = $( this ),
target = $( o.to ),
targetFixed = target.css( "position" ) === "fixed",
})
.animate( animation, o.duration, o.easing, function() {
transfer.remove();
- if ( $.isFunction( o.complete ) ) {
- o.complete.apply( elem[0], arguments );
- }
- next();
+ done();
});
};