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

Function defaultPrefilter

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

Source from the content-addressed store, hash-verified

6332}
6333
6334function defaultPrefilter( elem, props, opts ) {
6335 /* jshint validthis: true */
6336 var prop, value, toggle, tween, hooks, oldfire, display, checkDisplay,
6337 anim = this,
6338 orig = {},
6339 style = elem.style,
6340 hidden = elem.nodeType && isHidden( elem ),
6341 dataShow = data_priv.get( elem, "fxshow" );
6342
6343 // handle queue: false promises
6344 if ( !opts.queue ) {
6345 hooks = jQuery._queueHooks( elem, "fx" );
6346 if ( hooks.unqueued == null ) {
6347 hooks.unqueued = 0;
6348 oldfire = hooks.empty.fire;
6349 hooks.empty.fire = function() {
6350 if ( !hooks.unqueued ) {
6351 oldfire();
6352 }
6353 };
6354 }
6355 hooks.unqueued++;
6356
6357 anim.always(function() {
6358 // doing this makes sure that the complete handler will be called
6359 // before this completes
6360 anim.always(function() {
6361 hooks.unqueued--;
6362 if ( !jQuery.queue( elem, "fx" ).length ) {
6363 hooks.empty.fire();
6364 }
6365 });
6366 });
6367 }
6368
6369 // height/width overflow pass
6370 if ( elem.nodeType === 1 && ( "height" in props || "width" in props ) ) {
6371 // Make sure that nothing sneaks out
6372 // Record all 3 overflow attributes because IE9-10 do not
6373 // change the overflow attribute when overflowX and
6374 // overflowY are set to the same value
6375 opts.overflow = [ style.overflow, style.overflowX, style.overflowY ];
6376
6377 // Set display property to inline-block for height/width
6378 // animations on inline elements that are having width/height animated
6379 display = jQuery.css( elem, "display" );
6380
6381 // Test default display if display is currently "none"
6382 checkDisplay = display === "none" ?
6383 data_priv.get( elem, "olddisplay" ) || defaultDisplay( elem.nodeName ) : display;
6384
6385 if ( checkDisplay === "inline" && jQuery.css( elem, "float" ) === "none" ) {
6386 style.display = "inline-block";
6387 }
6388 }
6389
6390 if ( opts.overflow ) {
6391 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