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