Sha256: 023bf65a997690870048b3871cecadced18b246634bb06e7dec5cff351bc53ae

Contents?: true

Size: 1.96 KB

Versions: 31

Compression:

Stored size: 1.96 KB

Contents

/* */ 
"format amd";
/*!
 * jQuery UI Effects Scale 1.11.4
 * http://jqueryui.com
 *
 * Copyright jQuery Foundation and other contributors
 * Released under the MIT license.
 * http://jquery.org/license
 *
 * http://api.jqueryui.com/scale-effect/
 */
(function( factory ) {
	if ( typeof define === "function" && define.amd ) {

		// AMD. Register as an anonymous module.
		define(["jquery","./effect","./effect-size"], factory );
	} else {

		// Browser globals
		factory( jQuery );
	}
}(function( $ ) {

return $.effects.effect.scale = function( o, done ) {

	// Create element
	var el = $( this ),
		options = $.extend( true, {}, o ),
		mode = $.effects.setMode( el, o.mode || "effect" ),
		percent = parseInt( o.percent, 10 ) ||
			( parseInt( o.percent, 10 ) === 0 ? 0 : ( mode === "hide" ? 0 : 100 ) ),
		direction = o.direction || "both",
		origin = o.origin,
		original = {
			height: el.height(),
			width: el.width(),
			outerHeight: el.outerHeight(),
			outerWidth: el.outerWidth()
		},
		factor = {
			y: direction !== "horizontal" ? (percent / 100) : 1,
			x: direction !== "vertical" ? (percent / 100) : 1
		};

	// We are going to pass this effect to the size effect:
	options.effect = "size";
	options.queue = false;
	options.complete = done;

	// Set default origin and restore for show/hide
	if ( mode !== "effect" ) {
		options.origin = origin || [ "middle", "center" ];
		options.restore = true;
	}

	options.from = o.from || ( mode === "show" ? {
		height: 0,
		width: 0,
		outerHeight: 0,
		outerWidth: 0
	} : original );
	options.to = {
		height: original.height * factor.y,
		width: original.width * factor.x,
		outerHeight: original.outerHeight * factor.y,
		outerWidth: original.outerWidth * factor.x
	};

	// Fade option to support puff
	if ( options.fade ) {
		if ( mode === "show" ) {
			options.from.opacity = 0;
			options.to.opacity = 1;
		}
		if ( mode === "hide" ) {
			options.from.opacity = 1;
			options.to.opacity = 0;
		}
	}

	// Animate
	el.effect( options );

};

}));

Version data entries

31 entries across 31 versions & 1 rubygems

Version Path
sequenceserver-3.1.3 public/vendor/github/components/jqueryui@1.11.4/ui/effect-scale.js
sequenceserver-3.1.2 public/vendor/github/components/jqueryui@1.11.4/ui/effect-scale.js
sequenceserver-3.1.1 public/vendor/github/components/jqueryui@1.11.4/ui/effect-scale.js
sequenceserver-3.1.0 public/vendor/github/components/jqueryui@1.11.4/ui/effect-scale.js
sequenceserver-3.0.1 public/vendor/github/components/jqueryui@1.11.4/ui/effect-scale.js
sequenceserver-3.0 public/vendor/github/components/jqueryui@1.11.4/ui/effect-scale.js
sequenceserver-2.2.0 public/vendor/github/components/jqueryui@1.11.4/ui/effect-scale.js
sequenceserver-2.1.0 public/vendor/github/components/jqueryui@1.11.4/ui/effect-scale.js
sequenceserver-2.0.0 public/vendor/github/components/jqueryui@1.11.4/ui/effect-scale.js
sequenceserver-2.0.0.rc8 public/vendor/github/components/jqueryui@1.11.4/ui/effect-scale.js
sequenceserver-2.0.0.rc7 public/vendor/github/components/jqueryui@1.11.4/ui/effect-scale.js
sequenceserver-2.0.0.rc6 public/vendor/github/components/jqueryui@1.11.4/ui/effect-scale.js
sequenceserver-2.0.0.rc5 public/vendor/github/components/jqueryui@1.11.4/ui/effect-scale.js
sequenceserver-2.0.0.rc4 public/vendor/github/components/jqueryui@1.11.4/ui/effect-scale.js
sequenceserver-2.0.0.rc3 public/vendor/github/components/jqueryui@1.11.4/ui/effect-scale.js
sequenceserver-2.0.0.rc2 public/vendor/github/components/jqueryui@1.11.4/ui/effect-scale.js
sequenceserver-2.0.0.rc1 public/vendor/github/components/jqueryui@1.11.4/ui/effect-scale.js
sequenceserver-2.0.0.beta4 public/vendor/github/components/jqueryui@1.11.4/ui/effect-scale.js
sequenceserver-2.0.0.beta3 public/vendor/github/components/jqueryui@1.11.4/ui/effect-scale.js
sequenceserver-2.0.0.beta1 public/vendor/github/components/jqueryui@1.11.4/ui/effect-scale.js