// Set display property to inline-block for height/width
// animations on inline elements that are having width/height animated
display = jQuery.css( elem, "display" );
- dDisplay = defaultDisplay( elem.nodeName );
- if ( display === "none" ) {
- display = dDisplay;
- }
- if ( display === "inline" &&
+ // Test default display if display is currently "none"
+ if ( (display === "none" ? defaultDisplay( elem.nodeName ) : display) === "inline" &&
jQuery.css( elem, "float" ) === "none" ) {
// inline-level elements accept inline-block;
}
}
orig[ prop ] = dataShow && dataShow[ prop ] || jQuery.style( elem, prop );
+
+ // Any non-fx value stops us from restoring the original display value
+ } else {
+ display = undefined;
}
}
}
}
}
+
+ // If this is a noop like .hide().hide(), restore an overwritten display value
+ } else if ( (display === "none" ? defaultDisplay( elem.nodeName ) : display) === "inline" ) {
+ style.display = display;
}
}
this.clock.tick( 400 );
});
+test( "hide should not leave hidden inline elements visible (#14848)", 2, function() {
+ var el = jQuery("#simon1");
+
+ el.hide( 1, function() {
+ equal( el.css( "display" ), "none", "hidden" );
+ el.hide( 1, function() {
+ equal( el.css( "display" ), "none", "still hidden" );
+ });
+ });
+
+ this.clock.tick( 100 );
+});
+
test( "Handle queue:false promises", 10, function() {
var foo = jQuery( "#foo" ).clone().andSelf(),
step = 1;