Sha256: 1f329fb77fe40498347ca2be5b943bbb6ec689f1621141b7b59ab5a5f2285033

Contents?: true

Size: 1.44 KB

Versions: 13

Compression:

Stored size: 1.44 KB

Contents

/*!
 * jQuery UI Effects Drop @VERSION
 * http://jqueryui.com
 *
 * Copyright 2012 jQuery Foundation and other contributors
 * Released under the MIT license.
 * http://jquery.org/license
 *
 * http://api.jqueryui.com/drop-effect/
 *
 * Depends:
 *	jquery.ui.effect.js
 */
(function( $, undefined ) {

$.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" ]( 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() {
			if ( mode === "hide" ) {
				el.hide();
			}
			$.effects.restore( el, props );
			$.effects.removeWrapper( el );
			done();
		}
	});
};

})(jQuery);

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
spiderfw-1.0.1 apps/core/components/public/js/jquery/jquery-ui-1.9.2/ui/jquery.ui.effect-drop.js
spiderfw-1.0.0 apps/core/components/public/js/jquery/jquery-ui-1.9.2/ui/jquery.ui.effect-drop.js
spiderfw-0.6.39 apps/core/components/public/js/jquery/jquery-ui-1.9.2/ui/jquery.ui.effect-drop.js
spiderfw-0.6.38 apps/core/components/public/js/jquery/jquery-ui-1.9.2/ui/jquery.ui.effect-drop.js
spiderfw-0.6.37 apps/core/components/public/js/jquery/jquery-ui-1.9.2/ui/jquery.ui.effect-drop.js
spiderfw-0.6.35 apps/core/components/public/js/jquery/jquery-ui-1.9.2/ui/jquery.ui.effect-drop.js
spiderfw-0.6.34 apps/core/components/public/js/jquery/jquery-ui-1.9.2/ui/jquery.ui.effect-drop.js
spiderfw-0.6.33 apps/core/components/public/js/jquery/jquery-ui-1.9.2/ui/jquery.ui.effect-drop.js
spiderfw-0.6.32 apps/core/components/public/js/jquery/jquery-ui-1.9.2/ui/jquery.ui.effect-drop.js
spiderfw-0.6.31 apps/core/components/public/js/jquery/jquery-ui-1.9.2/ui/jquery.ui.effect-drop.js
spiderfw-0.6.30 apps/core/components/public/js/jquery/jquery-ui-1.9.2/ui/jquery.ui.effect-drop.js
spiderfw-0.6.29 apps/core/components/public/js/jquery/jquery-ui-1.9.2/ui/jquery.ui.effect-drop.js
spiderfw-0.6.28 apps/core/components/public/js/jquery/jquery-ui-1.9.2/ui/jquery.ui.effect-drop.js