]>
git.r.bdr.sh - rbdr/dotfiles/blob - atom/packages/ex-mode/node_modules/space-pen/node_modules/jquery/src/queue.js
199c56d366f6dd0099b03dde4488f0ad53b64513
3 "./data/var/data_priv",
6 ], function( jQuery
, data_priv
) {
9 queue: function( elem
, type
, data
) {
13 type
= ( type
|| "fx" ) + "queue";
14 queue
= data_priv
.get( elem
, type
);
16 // Speed up dequeue by getting out quickly if this is just a lookup
18 if ( !queue
|| jQuery
.isArray( data
) ) {
19 queue
= data_priv
.access( elem
, type
, jQuery
.makeArray(data
) );
28 dequeue: function( elem
, type
) {
31 var queue
= jQuery
.queue( elem
, type
),
32 startLength
= queue
.length
,
34 hooks
= jQuery
._queueHooks( elem
, type
),
36 jQuery
.dequeue( elem
, type
);
39 // If the fx queue is dequeued, always remove the progress sentinel
40 if ( fn
=== "inprogress" ) {
47 // Add a progress sentinel to prevent the fx queue from being
48 // automatically dequeued
49 if ( type
=== "fx" ) {
50 queue
.unshift( "inprogress" );
53 // Clear up the last queue stop function
55 fn
.call( elem
, next
, hooks
);
58 if ( !startLength
&& hooks
) {
63 // Not public - generate a queueHooks object, or return the current one
64 _queueHooks: function( elem
, type
) {
65 var key
= type
+ "queueHooks";
66 return data_priv
.get( elem
, key
) || data_priv
.access( elem
, key
, {
67 empty: jQuery
.Callbacks("once memory").add(function() {
68 data_priv
.remove( elem
, [ type
+ "queue", key
] );
75 queue: function( type
, data
) {
78 if ( typeof type
!== "string" ) {
84 if ( arguments
.length
< setter
) {
85 return jQuery
.queue( this[0], type
);
88 return data
=== undefined ?
90 this.each(function() {
91 var queue
= jQuery
.queue( this, type
, data
);
93 // Ensure a hooks for this queue
94 jQuery
._queueHooks( this, type
);
96 if ( type
=== "fx" && queue
[0] !== "inprogress" ) {
97 jQuery
.dequeue( this, type
);
101 dequeue: function( type
) {
102 return this.each(function() {
103 jQuery
.dequeue( this, type
);
106 clearQueue: function( type
) {
107 return this.queue( type
|| "fx", [] );
109 // Get a promise resolved when queues of a certain type
110 // are emptied (fx is the type by default)
111 promise: function( type
, obj
) {
114 defer
= jQuery
.Deferred(),
117 resolve = function() {
118 if ( !( --count
) ) {
119 defer
.resolveWith( elements
, [ elements
] );
123 if ( typeof type
!== "string" ) {
130 tmp
= data_priv
.get( elements
[ i
], type
+ "queueHooks" );
131 if ( tmp
&& tmp
.empty
) {
133 tmp
.empty
.add( resolve
);
137 return defer
.promise( obj
);