standard header in about page (#676)
[openemr.git] / public / assets / jquery-ui-1-12-1 / ui / effects / effect-fold.js
blobccfd67a558d0d870b9b69ad926d55578a7e818a6
1 /*!
2  * jQuery UI Effects Fold 1.12.1
3  * http://jqueryui.com
4  *
5  * Copyright jQuery Foundation and other contributors
6  * Released under the MIT license.
7  * http://jquery.org/license
8  */
10 //>>label: Fold Effect
11 //>>group: Effects
12 //>>description: Folds an element first horizontally and then vertically.
13 //>>docs: http://api.jqueryui.com/fold-effect/
14 //>>demos: http://jqueryui.com/effect/
16 ( function( factory ) {
17         if ( typeof define === "function" && define.amd ) {
19                 // AMD. Register as an anonymous module.
20                 define( [
21                         "jquery",
22                         "../version",
23                         "../effect"
24                 ], factory );
25         } else {
27                 // Browser globals
28                 factory( jQuery );
29         }
30 }( function( $ ) {
32 return $.effects.define( "fold", "hide", function( options, done ) {
34         // Create element
35         var element = $( this ),
36                 mode = options.mode,
37                 show = mode === "show",
38                 hide = mode === "hide",
39                 size = options.size || 15,
40                 percent = /([0-9]+)%/.exec( size ),
41                 horizFirst = !!options.horizFirst,
42                 ref = horizFirst ? [ "right", "bottom" ] : [ "bottom", "right" ],
43                 duration = options.duration / 2,
45                 placeholder = $.effects.createPlaceholder( element ),
47                 start = element.cssClip(),
48                 animation1 = { clip: $.extend( {}, start ) },
49                 animation2 = { clip: $.extend( {}, start ) },
51                 distance = [ start[ ref[ 0 ] ], start[ ref[ 1 ] ] ],
53                 queuelen = element.queue().length;
55         if ( percent ) {
56                 size = parseInt( percent[ 1 ], 10 ) / 100 * distance[ hide ? 0 : 1 ];
57         }
58         animation1.clip[ ref[ 0 ] ] = size;
59         animation2.clip[ ref[ 0 ] ] = size;
60         animation2.clip[ ref[ 1 ] ] = 0;
62         if ( show ) {
63                 element.cssClip( animation2.clip );
64                 if ( placeholder ) {
65                         placeholder.css( $.effects.clipToBox( animation2 ) );
66                 }
68                 animation2.clip = start;
69         }
71         // Animate
72         element
73                 .queue( function( next ) {
74                         if ( placeholder ) {
75                                 placeholder
76                                         .animate( $.effects.clipToBox( animation1 ), duration, options.easing )
77                                         .animate( $.effects.clipToBox( animation2 ), duration, options.easing );
78                         }
80                         next();
81                 } )
82                 .animate( animation1, duration, options.easing )
83                 .animate( animation2, duration, options.easing )
84                 .queue( done );
86         $.effects.unshift( element, queuelen, 4 );
87 } );
89 } ) );