MCPcopy Index your code
hub / github.com/JsAaron/jQuery / defaultPrefilter

Function defaultPrefilter

2.1.1/test/other.js:3741–3873  ·  view source on GitHub ↗
( elem, props, opts )

Source from the content-addressed store, hash-verified

3739}
3740
3741function defaultPrefilter( elem, props, opts ) {
3742 /* jshint validthis: true */
3743 var prop, value, toggle, tween, hooks, oldfire, display, checkDisplay,
3744 anim = this,
3745 orig = {},
3746 style = elem.style,
3747 hidden = elem.nodeType && isHidden( elem ),
3748 dataShow = data_priv.get( elem, "fxshow" );
3749
3750 // handle queue: false promises
3751 if ( !opts.queue ) {
3752 hooks = jQuery._queueHooks( elem, "fx" );
3753 if ( hooks.unqueued == null ) {
3754 hooks.unqueued = 0;
3755 oldfire = hooks.empty.fire;
3756 hooks.empty.fire = function() {
3757 if ( !hooks.unqueued ) {
3758 oldfire();
3759 }
3760 };
3761 }
3762 hooks.unqueued++;
3763
3764 anim.always(function() {
3765 // doing this makes sure that the complete handler will be called
3766 // before this completes
3767 anim.always(function() {
3768 hooks.unqueued--;
3769 if ( !jQuery.queue( elem, "fx" ).length ) {
3770 hooks.empty.fire();
3771 }
3772 });
3773 });
3774 }
3775
3776 // height/width overflow pass
3777 if ( elem.nodeType === 1 && ( "height" in props || "width" in props ) ) {
3778 // Make sure that nothing sneaks out
3779 // Record all 3 overflow attributes because IE9-10 do not
3780 // change the overflow attribute when overflowX and
3781 // overflowY are set to the same value
3782 opts.overflow = [ style.overflow, style.overflowX, style.overflowY ];
3783
3784 // Set display property to inline-block for height/width
3785 // animations on inline elements that are having width/height animated
3786 display = jQuery.css( elem, "display" );
3787
3788 // Test default display if display is currently "none"
3789 checkDisplay = display === "none" ?
3790 data_priv.get( elem, "olddisplay" ) || defaultDisplay( elem.nodeName ) : display;
3791
3792 if ( checkDisplay === "inline" && jQuery.css( elem, "float" ) === "none" ) {
3793 style.display = "inline-block";
3794 }
3795 }
3796
3797 if ( opts.overflow ) {
3798 style.overflow = "hidden";

Callers

nothing calls this directly

Calls 4

isHiddenFunction · 0.70
defaultDisplayFunction · 0.70
jQueryFunction · 0.70
createTweenFunction · 0.70

Tested by

no test coverage detected