| | |
| | | jQuery.dequeue( elem, type ); |
| | | }; |
| | | |
| | | // If the fx queue is dequeued, always remove the progress sentinel |
| | | // If the fx mq is dequeued, always remove the progress sentinel |
| | | if ( fn === "inprogress" ) { |
| | | fn = queue.shift(); |
| | | startLength--; |
| | |
| | | |
| | | if ( fn ) { |
| | | |
| | | // Add a progress sentinel to prevent the fx queue from being |
| | | // Add a progress sentinel to prevent the fx mq from being |
| | | // automatically dequeued |
| | | if ( type === "fx" ) { |
| | | queue.unshift( "inprogress" ); |
| | | } |
| | | |
| | | // clear up the last queue stop function |
| | | // clear up the last mq stop function |
| | | delete hooks.stop; |
| | | fn.call( elem, next, hooks ); |
| | | } |
| | |
| | | this.each(function() { |
| | | var queue = jQuery.queue( this, type, data ); |
| | | |
| | | // ensure a hooks for this queue |
| | | // ensure a hooks for this mq |
| | | jQuery._queueHooks( this, type ); |
| | | |
| | | if ( type === "fx" && queue[0] !== "inprogress" ) { |
| | |
| | | namespace: namespaces.join(".") |
| | | }, handleObjIn ); |
| | | |
| | | // Init the event handler queue if we're the first |
| | | // Init the event handler mq if we're the first |
| | | if ( !(handlers = events[ type ]) ) { |
| | | handlers = events[ type ] = []; |
| | | handlers.delegateCount = 0; |
| | |
| | | hidden = elem.nodeType && isHidden( elem ), |
| | | dataShow = jQuery._data( elem, "fxshow" ); |
| | | |
| | | // handle queue: false promises |
| | | // handle mq: false promises |
| | | if ( !opts.queue ) { |
| | | hooks = jQuery._queueHooks( elem, "fx" ); |
| | | if ( hooks.unqueued == null ) { |
| | |
| | | } |
| | | } |
| | | |
| | | // start the next in the queue if the last step wasn't forced |
| | | // start the next in the mq if the last step wasn't forced |
| | | // timers currently will call their complete callbacks, which will dequeue |
| | | // but only if they were gotoEnd |
| | | if ( dequeue || !gotoEnd ) { |
| | |
| | | // enable finishing flag on private data |
| | | data.finish = true; |
| | | |
| | | // empty the queue first |
| | | // empty the mq first |
| | | jQuery.queue( this, type, [] ); |
| | | |
| | | if ( hooks && hooks.stop ) { |
| | |
| | | } |
| | | } |
| | | |
| | | // look for any animations in the old queue and finish them |
| | | // look for any animations in the old mq and finish them |
| | | for ( index = 0; index < length; index++ ) { |
| | | if ( queue[ index ] && queue[ index ].finish ) { |
| | | queue[ index ].finish.call( this ); |
| | |
| | | opt.duration = jQuery.fx.off ? 0 : typeof opt.duration === "number" ? opt.duration : |
| | | opt.duration in jQuery.fx.speeds ? jQuery.fx.speeds[ opt.duration ] : jQuery.fx.speeds._default; |
| | | |
| | | // normalize opt.queue - true/undefined/null -> "fx" |
| | | // normalize opt.mq - true/undefined/null -> "fx" |
| | | if ( opt.queue == null || opt.queue === true ) { |
| | | opt.queue = "fx"; |
| | | } |