| @@ 7552-7695 (lines=144) @@ | ||
| 7549 | } |
|
| 7550 | } |
|
| 7551 | ||
| 7552 | function defaultPrefilter( elem, props, opts ) { |
|
| 7553 | /* jshint validthis: true */ |
|
| 7554 | var prop, value, toggle, tween, hooks, oldfire, display, checkDisplay, |
|
| 7555 | anim = this, |
|
| 7556 | orig = {}, |
|
| 7557 | style = elem.style, |
|
| 7558 | hidden = elem.nodeType && isHidden( elem ), |
|
| 7559 | dataShow = jQuery._data( elem, "fxshow" ); |
|
| 7560 | ||
| 7561 | // handle queue: false promises |
|
| 7562 | if ( !opts.queue ) { |
|
| 7563 | hooks = jQuery._queueHooks( elem, "fx" ); |
|
| 7564 | if ( hooks.unqueued == null ) { |
|
| 7565 | hooks.unqueued = 0; |
|
| 7566 | oldfire = hooks.empty.fire; |
|
| 7567 | hooks.empty.fire = function() { |
|
| 7568 | if ( !hooks.unqueued ) { |
|
| 7569 | oldfire(); |
|
| 7570 | } |
|
| 7571 | }; |
|
| 7572 | } |
|
| 7573 | hooks.unqueued++; |
|
| 7574 | ||
| 7575 | anim.always( function() { |
|
| 7576 | ||
| 7577 | // doing this makes sure that the complete handler will be called |
|
| 7578 | // before this completes |
|
| 7579 | anim.always( function() { |
|
| 7580 | hooks.unqueued--; |
|
| 7581 | if ( !jQuery.queue( elem, "fx" ).length ) { |
|
| 7582 | hooks.empty.fire(); |
|
| 7583 | } |
|
| 7584 | } ); |
|
| 7585 | } ); |
|
| 7586 | } |
|
| 7587 | ||
| 7588 | // height/width overflow pass |
|
| 7589 | if ( elem.nodeType === 1 && ( "height" in props || "width" in props ) ) { |
|
| 7590 | ||
| 7591 | // Make sure that nothing sneaks out |
|
| 7592 | // Record all 3 overflow attributes because IE does not |
|
| 7593 | // change the overflow attribute when overflowX and |
|
| 7594 | // overflowY are set to the same value |
|
| 7595 | opts.overflow = [ style.overflow, style.overflowX, style.overflowY ]; |
|
| 7596 | ||
| 7597 | // Set display property to inline-block for height/width |
|
| 7598 | // animations on inline elements that are having width/height animated |
|
| 7599 | display = jQuery.css( elem, "display" ); |
|
| 7600 | ||
| 7601 | // Test default display if display is currently "none" |
|
| 7602 | checkDisplay = display === "none" ? |
|
| 7603 | jQuery._data( elem, "olddisplay" ) || defaultDisplay( elem.nodeName ) : display; |
|
| 7604 | ||
| 7605 | if ( checkDisplay === "inline" && jQuery.css( elem, "float" ) === "none" ) { |
|
| 7606 | ||
| 7607 | // inline-level elements accept inline-block; |
|
| 7608 | // block-level elements need to be inline with layout |
|
| 7609 | if ( !support.inlineBlockNeedsLayout || defaultDisplay( elem.nodeName ) === "inline" ) { |
|
| 7610 | style.display = "inline-block"; |
|
| 7611 | } else { |
|
| 7612 | style.zoom = 1; |
|
| 7613 | } |
|
| 7614 | } |
|
| 7615 | } |
|
| 7616 | ||
| 7617 | if ( opts.overflow ) { |
|
| 7618 | style.overflow = "hidden"; |
|
| 7619 | if ( !support.shrinkWrapBlocks() ) { |
|
| 7620 | anim.always( function() { |
|
| 7621 | style.overflow = opts.overflow[ 0 ]; |
|
| 7622 | style.overflowX = opts.overflow[ 1 ]; |
|
| 7623 | style.overflowY = opts.overflow[ 2 ]; |
|
| 7624 | } ); |
|
| 7625 | } |
|
| 7626 | } |
|
| 7627 | ||
| 7628 | // show/hide pass |
|
| 7629 | for ( prop in props ) { |
|
| 7630 | value = props[ prop ]; |
|
| 7631 | if ( rfxtypes.exec( value ) ) { |
|
| 7632 | delete props[ prop ]; |
|
| 7633 | toggle = toggle || value === "toggle"; |
|
| 7634 | if ( value === ( hidden ? "hide" : "show" ) ) { |
|
| 7635 | ||
| 7636 | // If there is dataShow left over from a stopped hide or show |
|
| 7637 | // and we are going to proceed with show, we should pretend to be hidden |
|
| 7638 | if ( value === "show" && dataShow && dataShow[ prop ] !== undefined ) { |
|
| 7639 | hidden = true; |
|
| 7640 | } else { |
|
| 7641 | continue; |
|
| 7642 | } |
|
| 7643 | } |
|
| 7644 | orig[ prop ] = dataShow && dataShow[ prop ] || jQuery.style( elem, prop ); |
|
| 7645 | ||
| 7646 | // Any non-fx value stops us from restoring the original display value |
|
| 7647 | } else { |
|
| 7648 | display = undefined; |
|
| 7649 | } |
|
| 7650 | } |
|
| 7651 | ||
| 7652 | if ( !jQuery.isEmptyObject( orig ) ) { |
|
| 7653 | if ( dataShow ) { |
|
| 7654 | if ( "hidden" in dataShow ) { |
|
| 7655 | hidden = dataShow.hidden; |
|
| 7656 | } |
|
| 7657 | } else { |
|
| 7658 | dataShow = jQuery._data( elem, "fxshow", {} ); |
|
| 7659 | } |
|
| 7660 | ||
| 7661 | // store state if its toggle - enables .stop().toggle() to "reverse" |
|
| 7662 | if ( toggle ) { |
|
| 7663 | dataShow.hidden = !hidden; |
|
| 7664 | } |
|
| 7665 | if ( hidden ) { |
|
| 7666 | jQuery( elem ).show(); |
|
| 7667 | } else { |
|
| 7668 | anim.done( function() { |
|
| 7669 | jQuery( elem ).hide(); |
|
| 7670 | } ); |
|
| 7671 | } |
|
| 7672 | anim.done( function() { |
|
| 7673 | var prop; |
|
| 7674 | jQuery._removeData( elem, "fxshow" ); |
|
| 7675 | for ( prop in orig ) { |
|
| 7676 | jQuery.style( elem, prop, orig[ prop ] ); |
|
| 7677 | } |
|
| 7678 | } ); |
|
| 7679 | for ( prop in orig ) { |
|
| 7680 | tween = createTween( hidden ? dataShow[ prop ] : 0, prop, anim ); |
|
| 7681 | ||
| 7682 | if ( !( prop in dataShow ) ) { |
|
| 7683 | dataShow[ prop ] = tween.start; |
|
| 7684 | if ( hidden ) { |
|
| 7685 | tween.end = tween.start; |
|
| 7686 | tween.start = prop === "width" || prop === "height" ? 1 : 0; |
|
| 7687 | } |
|
| 7688 | } |
|
| 7689 | } |
|
| 7690 | ||
| 7691 | // If this is a noop like .hide().hide(), restore an overwritten display value |
|
| 7692 | } else if ( ( display === "none" ? defaultDisplay( elem.nodeName ) : display ) === "inline" ) { |
|
| 7693 | style.display = display; |
|
| 7694 | } |
|
| 7695 | } |
|
| 7696 | ||
| 7697 | function propFilter( props, specialEasing ) { |
|
| 7698 | var index, name, easing, value, hooks; |
|
| @@ 6514-6648 (lines=135) @@ | ||
| 6511 | } |
|
| 6512 | } |
|
| 6513 | ||
| 6514 | function defaultPrefilter( elem, props, opts ) { |
|
| 6515 | /* jshint validthis: true */ |
|
| 6516 | var prop, value, toggle, tween, hooks, oldfire, display, checkDisplay, |
|
| 6517 | anim = this, |
|
| 6518 | orig = {}, |
|
| 6519 | style = elem.style, |
|
| 6520 | hidden = elem.nodeType && isHidden( elem ), |
|
| 6521 | dataShow = dataPriv.get( elem, "fxshow" ); |
|
| 6522 | ||
| 6523 | // Handle queue: false promises |
|
| 6524 | if ( !opts.queue ) { |
|
| 6525 | hooks = jQuery._queueHooks( elem, "fx" ); |
|
| 6526 | if ( hooks.unqueued == null ) { |
|
| 6527 | hooks.unqueued = 0; |
|
| 6528 | oldfire = hooks.empty.fire; |
|
| 6529 | hooks.empty.fire = function() { |
|
| 6530 | if ( !hooks.unqueued ) { |
|
| 6531 | oldfire(); |
|
| 6532 | } |
|
| 6533 | }; |
|
| 6534 | } |
|
| 6535 | hooks.unqueued++; |
|
| 6536 | ||
| 6537 | anim.always( function() { |
|
| 6538 | ||
| 6539 | // Ensure the complete handler is called before this completes |
|
| 6540 | anim.always( function() { |
|
| 6541 | hooks.unqueued--; |
|
| 6542 | if ( !jQuery.queue( elem, "fx" ).length ) { |
|
| 6543 | hooks.empty.fire(); |
|
| 6544 | } |
|
| 6545 | } ); |
|
| 6546 | } ); |
|
| 6547 | } |
|
| 6548 | ||
| 6549 | // Height/width overflow pass |
|
| 6550 | if ( elem.nodeType === 1 && ( "height" in props || "width" in props ) ) { |
|
| 6551 | ||
| 6552 | // Make sure that nothing sneaks out |
|
| 6553 | // Record all 3 overflow attributes because IE9-10 do not |
|
| 6554 | // change the overflow attribute when overflowX and |
|
| 6555 | // overflowY are set to the same value |
|
| 6556 | opts.overflow = [ style.overflow, style.overflowX, style.overflowY ]; |
|
| 6557 | ||
| 6558 | // Set display property to inline-block for height/width |
|
| 6559 | // animations on inline elements that are having width/height animated |
|
| 6560 | display = jQuery.css( elem, "display" ); |
|
| 6561 | ||
| 6562 | // Test default display if display is currently "none" |
|
| 6563 | checkDisplay = display === "none" ? |
|
| 6564 | dataPriv.get( elem, "olddisplay" ) || defaultDisplay( elem.nodeName ) : display; |
|
| 6565 | ||
| 6566 | if ( checkDisplay === "inline" && jQuery.css( elem, "float" ) === "none" ) { |
|
| 6567 | style.display = "inline-block"; |
|
| 6568 | } |
|
| 6569 | } |
|
| 6570 | ||
| 6571 | if ( opts.overflow ) { |
|
| 6572 | style.overflow = "hidden"; |
|
| 6573 | anim.always( function() { |
|
| 6574 | style.overflow = opts.overflow[ 0 ]; |
|
| 6575 | style.overflowX = opts.overflow[ 1 ]; |
|
| 6576 | style.overflowY = opts.overflow[ 2 ]; |
|
| 6577 | } ); |
|
| 6578 | } |
|
| 6579 | ||
| 6580 | // show/hide pass |
|
| 6581 | for ( prop in props ) { |
|
| 6582 | value = props[ prop ]; |
|
| 6583 | if ( rfxtypes.exec( value ) ) { |
|
| 6584 | delete props[ prop ]; |
|
| 6585 | toggle = toggle || value === "toggle"; |
|
| 6586 | if ( value === ( hidden ? "hide" : "show" ) ) { |
|
| 6587 | ||
| 6588 | // If there is dataShow left over from a stopped hide or show |
|
| 6589 | // and we are going to proceed with show, we should pretend to be hidden |
|
| 6590 | if ( value === "show" && dataShow && dataShow[ prop ] !== undefined ) { |
|
| 6591 | hidden = true; |
|
| 6592 | } else { |
|
| 6593 | continue; |
|
| 6594 | } |
|
| 6595 | } |
|
| 6596 | orig[ prop ] = dataShow && dataShow[ prop ] || jQuery.style( elem, prop ); |
|
| 6597 | ||
| 6598 | // Any non-fx value stops us from restoring the original display value |
|
| 6599 | } else { |
|
| 6600 | display = undefined; |
|
| 6601 | } |
|
| 6602 | } |
|
| 6603 | ||
| 6604 | if ( !jQuery.isEmptyObject( orig ) ) { |
|
| 6605 | if ( dataShow ) { |
|
| 6606 | if ( "hidden" in dataShow ) { |
|
| 6607 | hidden = dataShow.hidden; |
|
| 6608 | } |
|
| 6609 | } else { |
|
| 6610 | dataShow = dataPriv.access( elem, "fxshow", {} ); |
|
| 6611 | } |
|
| 6612 | ||
| 6613 | // Store state if its toggle - enables .stop().toggle() to "reverse" |
|
| 6614 | if ( toggle ) { |
|
| 6615 | dataShow.hidden = !hidden; |
|
| 6616 | } |
|
| 6617 | if ( hidden ) { |
|
| 6618 | jQuery( elem ).show(); |
|
| 6619 | } else { |
|
| 6620 | anim.done( function() { |
|
| 6621 | jQuery( elem ).hide(); |
|
| 6622 | } ); |
|
| 6623 | } |
|
| 6624 | anim.done( function() { |
|
| 6625 | var prop; |
|
| 6626 | ||
| 6627 | dataPriv.remove( elem, "fxshow" ); |
|
| 6628 | for ( prop in orig ) { |
|
| 6629 | jQuery.style( elem, prop, orig[ prop ] ); |
|
| 6630 | } |
|
| 6631 | } ); |
|
| 6632 | for ( prop in orig ) { |
|
| 6633 | tween = createTween( hidden ? dataShow[ prop ] : 0, prop, anim ); |
|
| 6634 | ||
| 6635 | if ( !( prop in dataShow ) ) { |
|
| 6636 | dataShow[ prop ] = tween.start; |
|
| 6637 | if ( hidden ) { |
|
| 6638 | tween.end = tween.start; |
|
| 6639 | tween.start = prop === "width" || prop === "height" ? 1 : 0; |
|
| 6640 | } |
|
| 6641 | } |
|
| 6642 | } |
|
| 6643 | ||
| 6644 | // If this is a noop like .hide().hide(), restore an overwritten display value |
|
| 6645 | } else if ( ( display === "none" ? defaultDisplay( elem.nodeName ) : display ) === "inline" ) { |
|
| 6646 | style.display = display; |
|
| 6647 | } |
|
| 6648 | } |
|
| 6649 | ||
| 6650 | function propFilter( props, specialEasing ) { |
|
| 6651 | var index, name, easing, value, hooks; |
|
| @@ 6335-6467 (lines=133) @@ | ||
| 6332 | } |
|
| 6333 | } |
|
| 6334 | ||
| 6335 | function defaultPrefilter( elem, props, opts ) { |
|
| 6336 | /* jshint validthis: true */ |
|
| 6337 | var prop, value, toggle, tween, hooks, oldfire, display, checkDisplay, |
|
| 6338 | anim = this, |
|
| 6339 | orig = {}, |
|
| 6340 | style = elem.style, |
|
| 6341 | hidden = elem.nodeType && isHidden( elem ), |
|
| 6342 | dataShow = data_priv.get( elem, "fxshow" ); |
|
| 6343 | ||
| 6344 | // handle queue: false promises |
|
| 6345 | if ( !opts.queue ) { |
|
| 6346 | hooks = jQuery._queueHooks( elem, "fx" ); |
|
| 6347 | if ( hooks.unqueued == null ) { |
|
| 6348 | hooks.unqueued = 0; |
|
| 6349 | oldfire = hooks.empty.fire; |
|
| 6350 | hooks.empty.fire = function() { |
|
| 6351 | if ( !hooks.unqueued ) { |
|
| 6352 | oldfire(); |
|
| 6353 | } |
|
| 6354 | }; |
|
| 6355 | } |
|
| 6356 | hooks.unqueued++; |
|
| 6357 | ||
| 6358 | anim.always(function() { |
|
| 6359 | // doing this makes sure that the complete handler will be called |
|
| 6360 | // before this completes |
|
| 6361 | anim.always(function() { |
|
| 6362 | hooks.unqueued--; |
|
| 6363 | if ( !jQuery.queue( elem, "fx" ).length ) { |
|
| 6364 | hooks.empty.fire(); |
|
| 6365 | } |
|
| 6366 | }); |
|
| 6367 | }); |
|
| 6368 | } |
|
| 6369 | ||
| 6370 | // height/width overflow pass |
|
| 6371 | if ( elem.nodeType === 1 && ( "height" in props || "width" in props ) ) { |
|
| 6372 | // Make sure that nothing sneaks out |
|
| 6373 | // Record all 3 overflow attributes because IE9-10 do not |
|
| 6374 | // change the overflow attribute when overflowX and |
|
| 6375 | // overflowY are set to the same value |
|
| 6376 | opts.overflow = [ style.overflow, style.overflowX, style.overflowY ]; |
|
| 6377 | ||
| 6378 | // Set display property to inline-block for height/width |
|
| 6379 | // animations on inline elements that are having width/height animated |
|
| 6380 | display = jQuery.css( elem, "display" ); |
|
| 6381 | ||
| 6382 | // Test default display if display is currently "none" |
|
| 6383 | checkDisplay = display === "none" ? |
|
| 6384 | data_priv.get( elem, "olddisplay" ) || defaultDisplay( elem.nodeName ) : display; |
|
| 6385 | ||
| 6386 | if ( checkDisplay === "inline" && jQuery.css( elem, "float" ) === "none" ) { |
|
| 6387 | style.display = "inline-block"; |
|
| 6388 | } |
|
| 6389 | } |
|
| 6390 | ||
| 6391 | if ( opts.overflow ) { |
|
| 6392 | style.overflow = "hidden"; |
|
| 6393 | anim.always(function() { |
|
| 6394 | style.overflow = opts.overflow[ 0 ]; |
|
| 6395 | style.overflowX = opts.overflow[ 1 ]; |
|
| 6396 | style.overflowY = opts.overflow[ 2 ]; |
|
| 6397 | }); |
|
| 6398 | } |
|
| 6399 | ||
| 6400 | // show/hide pass |
|
| 6401 | for ( prop in props ) { |
|
| 6402 | value = props[ prop ]; |
|
| 6403 | if ( rfxtypes.exec( value ) ) { |
|
| 6404 | delete props[ prop ]; |
|
| 6405 | toggle = toggle || value === "toggle"; |
|
| 6406 | if ( value === ( hidden ? "hide" : "show" ) ) { |
|
| 6407 | ||
| 6408 | // If there is dataShow left over from a stopped hide or show and we are going to proceed with show, we should pretend to be hidden |
|
| 6409 | if ( value === "show" && dataShow && dataShow[ prop ] !== undefined ) { |
|
| 6410 | hidden = true; |
|
| 6411 | } else { |
|
| 6412 | continue; |
|
| 6413 | } |
|
| 6414 | } |
|
| 6415 | orig[ prop ] = dataShow && dataShow[ prop ] || jQuery.style( elem, prop ); |
|
| 6416 | ||
| 6417 | // Any non-fx value stops us from restoring the original display value |
|
| 6418 | } else { |
|
| 6419 | display = undefined; |
|
| 6420 | } |
|
| 6421 | } |
|
| 6422 | ||
| 6423 | if ( !jQuery.isEmptyObject( orig ) ) { |
|
| 6424 | if ( dataShow ) { |
|
| 6425 | if ( "hidden" in dataShow ) { |
|
| 6426 | hidden = dataShow.hidden; |
|
| 6427 | } |
|
| 6428 | } else { |
|
| 6429 | dataShow = data_priv.access( elem, "fxshow", {} ); |
|
| 6430 | } |
|
| 6431 | ||
| 6432 | // store state if its toggle - enables .stop().toggle() to "reverse" |
|
| 6433 | if ( toggle ) { |
|
| 6434 | dataShow.hidden = !hidden; |
|
| 6435 | } |
|
| 6436 | if ( hidden ) { |
|
| 6437 | jQuery( elem ).show(); |
|
| 6438 | } else { |
|
| 6439 | anim.done(function() { |
|
| 6440 | jQuery( elem ).hide(); |
|
| 6441 | }); |
|
| 6442 | } |
|
| 6443 | anim.done(function() { |
|
| 6444 | var prop; |
|
| 6445 | ||
| 6446 | data_priv.remove( elem, "fxshow" ); |
|
| 6447 | for ( prop in orig ) { |
|
| 6448 | jQuery.style( elem, prop, orig[ prop ] ); |
|
| 6449 | } |
|
| 6450 | }); |
|
| 6451 | for ( prop in orig ) { |
|
| 6452 | tween = createTween( hidden ? dataShow[ prop ] : 0, prop, anim ); |
|
| 6453 | ||
| 6454 | if ( !( prop in dataShow ) ) { |
|
| 6455 | dataShow[ prop ] = tween.start; |
|
| 6456 | if ( hidden ) { |
|
| 6457 | tween.end = tween.start; |
|
| 6458 | tween.start = prop === "width" || prop === "height" ? 1 : 0; |
|
| 6459 | } |
|
| 6460 | } |
|
| 6461 | } |
|
| 6462 | ||
| 6463 | // If this is a noop like .hide().hide(), restore an overwritten display value |
|
| 6464 | } else if ( (display === "none" ? defaultDisplay( elem.nodeName ) : display) === "inline" ) { |
|
| 6465 | style.display = display; |
|
| 6466 | } |
|
| 6467 | } |
|
| 6468 | ||
| 6469 | function propFilter( props, specialEasing ) { |
|
| 6470 | var index, name, easing, value, hooks; |
|