PageRenderTime 23ms CodeModel.GetById 14ms app.highlight 6ms RepoModel.GetById 2ms app.codeStats 0ms

/application/static/libs/adminlte/bower_components/jquery-ui/ui/effect-puff.js

https://bitbucket.org/tin_gimranoff/docstar
JavaScript | 60 lines | 42 code | 6 blank | 12 comment | 5 complexity | 0c4a88ea7792164188a9ffe7d6203058 MD5 | raw file
 1/*!
 2 * jQuery UI Effects Puff 1.11.4
 3 * http://jqueryui.com
 4 *
 5 * Copyright jQuery Foundation and other contributors
 6 * Released under the MIT license.
 7 * http://jquery.org/license
 8 *
 9 * http://api.jqueryui.com/puff-effect/
10 */
11(function( factory ) {
12	if ( typeof define === "function" && define.amd ) {
13
14		// AMD. Register as an anonymous module.
15		define([
16			"jquery",
17			"./effect",
18			"./effect-scale"
19		], factory );
20	} else {
21
22		// Browser globals
23		factory( jQuery );
24	}
25}(function( $ ) {
26
27return $.effects.effect.puff = function( o, done ) {
28	var elem = $( this ),
29		mode = $.effects.setMode( elem, o.mode || "hide" ),
30		hide = mode === "hide",
31		percent = parseInt( o.percent, 10 ) || 150,
32		factor = percent / 100,
33		original = {
34			height: elem.height(),
35			width: elem.width(),
36			outerHeight: elem.outerHeight(),
37			outerWidth: elem.outerWidth()
38		};
39
40	$.extend( o, {
41		effect: "scale",
42		queue: false,
43		fade: true,
44		mode: mode,
45		complete: done,
46		percent: hide ? percent : 100,
47		from: hide ?
48			original :
49			{
50				height: original.height * factor,
51				width: original.width * factor,
52				outerHeight: original.outerHeight * factor,
53				outerWidth: original.outerWidth * factor
54			}
55	});
56
57	elem.effect( o );
58};
59
60}));