MCPcopy Create free account
hub / github.com/JsAaron/jQuery / defaultPrefilter

Function defaultPrefilter

2.1.1/test/jquery-1.11.1.js:7105–7245  ·  view source on GitHub ↗
( elem, props, opts )

Source from the content-addressed store, hash-verified

7103}
7104
7105function defaultPrefilter( elem, props, opts ) {
7106 /* jshint validthis: true */
7107 var prop, value, toggle, tween, hooks, oldfire, display, checkDisplay,
7108 anim = this,
7109 orig = {},
7110 style = elem.style,
7111 hidden = elem.nodeType && isHidden( elem ),
7112 dataShow = jQuery._data( elem, "fxshow" );
7113
7114 // handle queue: false promises
7115 if ( !opts.queue ) {
7116 hooks = jQuery._queueHooks( elem, "fx" );
7117 if ( hooks.unqueued == null ) {
7118 hooks.unqueued = 0;
7119 oldfire = hooks.empty.fire;
7120 hooks.empty.fire = function() {
7121 if ( !hooks.unqueued ) {
7122 oldfire();
7123 }
7124 };
7125 }
7126 hooks.unqueued++;
7127
7128 anim.always(function() {
7129 // doing this makes sure that the complete handler will be called
7130 // before this completes
7131 anim.always(function() {
7132 hooks.unqueued--;
7133 if ( !jQuery.queue( elem, "fx" ).length ) {
7134 hooks.empty.fire();
7135 }
7136 });
7137 });
7138 }
7139
7140 // height/width overflow pass
7141 if ( elem.nodeType === 1 && ( "height" in props || "width" in props ) ) {
7142 // Make sure that nothing sneaks out
7143 // Record all 3 overflow attributes because IE does not
7144 // change the overflow attribute when overflowX and
7145 // overflowY are set to the same value
7146 opts.overflow = [ style.overflow, style.overflowX, style.overflowY ];
7147
7148 // Set display property to inline-block for height/width
7149 // animations on inline elements that are having width/height animated
7150 display = jQuery.css( elem, "display" );
7151
7152 // Test default display if display is currently "none"
7153 checkDisplay = display === "none" ?
7154 jQuery._data( elem, "olddisplay" ) || defaultDisplay( elem.nodeName ) : display;
7155
7156 if ( checkDisplay === "inline" && jQuery.css( elem, "float" ) === "none" ) {
7157
7158 // inline-level elements accept inline-block;
7159 // block-level elements need to be inline with layout
7160 if ( !support.inlineBlockNeedsLayout || defaultDisplay( elem.nodeName ) === "inline" ) {
7161 style.display = "inline-block";
7162 } else {

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