diff options
author | Oleg Gaidarenko <markelog@gmail.com> | 2015-08-16 09:59:58 +0300 |
---|---|---|
committer | Oleg Gaidarenko <markelog@gmail.com> | 2015-09-07 20:03:50 +0300 |
commit | 10fdad742a2a6aa9f0e00b3e04fc5264797c53c7 (patch) | |
tree | 6b6d7b1375ff88f4bebbfa0703f7b595eb485df9 /src/queue.js | |
parent | 7aa46e0df8a673e6b00550bbbbed21eed50108b7 (diff) | |
download | jquery-10fdad742a2a6aa9f0e00b3e04fc5264797c53c7.tar.gz jquery-10fdad742a2a6aa9f0e00b3e04fc5264797c53c7.zip |
Build: Update jscs and lint files
Fixes gh-2056
Diffstat (limited to 'src/queue.js')
-rw-r--r-- | src/queue.js | 33 |
1 files changed, 17 insertions, 16 deletions
diff --git a/src/queue.js b/src/queue.js index 235439fa6..813c41cd3 100644 --- a/src/queue.js +++ b/src/queue.js @@ -1,11 +1,11 @@ -define([ +define( [ "./core", "./data/var/dataPriv", "./deferred", "./callbacks" ], function( jQuery, dataPriv ) { -jQuery.extend({ +jQuery.extend( { queue: function( elem, type, data ) { var queue; @@ -16,7 +16,7 @@ jQuery.extend({ // Speed up dequeue by getting out quickly if this is just a lookup if ( data ) { if ( !queue || jQuery.isArray( data ) ) { - queue = dataPriv.access( elem, type, jQuery.makeArray(data) ); + queue = dataPriv.access( elem, type, jQuery.makeArray( data ) ); } else { queue.push( data ); } @@ -64,14 +64,14 @@ jQuery.extend({ _queueHooks: function( elem, type ) { var key = type + "queueHooks"; return dataPriv.get( elem, key ) || dataPriv.access( elem, key, { - empty: jQuery.Callbacks("once memory").add(function() { + empty: jQuery.Callbacks( "once memory" ).add( function() { dataPriv.remove( elem, [ type + "queue", key ] ); - }) - }); + } ) + } ); } -}); +} ); -jQuery.fn.extend({ +jQuery.fn.extend( { queue: function( type, data ) { var setter = 2; @@ -82,30 +82,31 @@ jQuery.fn.extend({ } if ( arguments.length < setter ) { - return jQuery.queue( this[0], type ); + return jQuery.queue( this[ 0 ], type ); } return data === undefined ? this : - this.each(function() { + this.each( function() { var queue = jQuery.queue( this, type, data ); // Ensure a hooks for this queue jQuery._queueHooks( this, type ); - if ( type === "fx" && queue[0] !== "inprogress" ) { + if ( type === "fx" && queue[ 0 ] !== "inprogress" ) { jQuery.dequeue( this, type ); } - }); + } ); }, dequeue: function( type ) { - return this.each(function() { + return this.each( function() { jQuery.dequeue( this, type ); - }); + } ); }, clearQueue: function( type ) { return this.queue( type || "fx", [] ); }, + // Get a promise resolved when queues of a certain type // are emptied (fx is the type by default) promise: function( type, obj ) { @@ -136,7 +137,7 @@ jQuery.fn.extend({ resolve(); return defer.promise( obj ); } -}); +} ); return jQuery; -}); +} ); |