commiting uncommited changes on live site
[weblabels.fsf.org.git] / crm.fsf.org / 20131203 / files / sites / all / modules-new / civicrm / bower_components / jquery-ui / ui / effect-drop.js
1 /*!
2 * jQuery UI Effects Drop 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/drop-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 ], factory );
19 } else {
20
21 // Browser globals
22 factory( jQuery );
23 }
24 }(function( $ ) {
25
26 return $.effects.effect.drop = function( o, done ) {
27
28 var el = $( this ),
29 props = [ "position", "top", "bottom", "left", "right", "opacity", "height", "width" ],
30 mode = $.effects.setMode( el, o.mode || "hide" ),
31 show = mode === "show",
32 direction = o.direction || "left",
33 ref = ( direction === "up" || direction === "down" ) ? "top" : "left",
34 motion = ( direction === "up" || direction === "left" ) ? "pos" : "neg",
35 animation = {
36 opacity: show ? 1 : 0
37 },
38 distance;
39
40 // Adjust
41 $.effects.save( el, props );
42 el.show();
43 $.effects.createWrapper( el );
44
45 distance = o.distance || el[ ref === "top" ? "outerHeight" : "outerWidth" ]( true ) / 2;
46
47 if ( show ) {
48 el
49 .css( "opacity", 0 )
50 .css( ref, motion === "pos" ? -distance : distance );
51 }
52
53 // Animation
54 animation[ ref ] = ( show ?
55 ( motion === "pos" ? "+=" : "-=" ) :
56 ( motion === "pos" ? "-=" : "+=" ) ) +
57 distance;
58
59 // Animate
60 el.animate( animation, {
61 queue: false,
62 duration: o.duration,
63 easing: o.easing,
64 complete: function() {
65 if ( mode === "hide" ) {
66 el.hide();
67 }
68 $.effects.restore( el, props );
69 $.effects.removeWrapper( el );
70 done();
71 }
72 });
73 };
74
75 }));