mirror of
https://github.com/jquery/jquery-ui.git
synced 2024-11-21 11:04:24 +00:00
Effects: Delegate to core show/hide when the element is already in the correct final state. This forces the element to go through the olddisplay tracking and forces styles on elements even if they're hidden via an ancestor. Fixes #9120 - Effects: .hide() inconsistent with core with a hidden parent.
This commit is contained in:
parent
d0ad572349
commit
948563b8b5
@ -96,7 +96,9 @@
|
||||
<h2 id="qunit-userAgent"></h2>
|
||||
<ol id="qunit-tests"></ol>
|
||||
<div id="qunit-fixture">
|
||||
<div class="hidden test"></div>
|
||||
<div class="hidden test">
|
||||
<div>.</div>
|
||||
</div>
|
||||
<div class="animateClass test">
|
||||
<h2>Child Element Test</h2>
|
||||
</div>
|
||||
|
@ -28,6 +28,14 @@ test( "Immediate Return Conditions", function() {
|
||||
equal( ++count, 3, "Both Functions worked properly" );
|
||||
});
|
||||
|
||||
test( ".hide() with hidden parent", function() {
|
||||
expect( 1 );
|
||||
var element = $( "div.hidden" ).children();
|
||||
element.hide( "blind", function() {
|
||||
equal( element.css( "display" ), "none", "display: none" );
|
||||
});
|
||||
});
|
||||
|
||||
asyncTest( "Parse of null for options", function() {
|
||||
var hidden = $( "div.hidden" ),
|
||||
count = 0;
|
||||
|
5
ui/jquery.ui.effect.js
vendored
5
ui/jquery.ui.effect.js
vendored
@ -1150,9 +1150,10 @@ $.fn.extend({
|
||||
}
|
||||
}
|
||||
|
||||
// if the element is hiddden and mode is hide,
|
||||
// or element is visible and mode is show
|
||||
// If the element already has the correct final state, delegate to
|
||||
// the core methods so the internal tracking of "olddisplay" works.
|
||||
if ( elem.is( ":hidden" ) ? mode === "hide" : mode === "show" ) {
|
||||
elem[ mode ]();
|
||||
done();
|
||||
} else {
|
||||
effectMethod.call( elem[0], args, done );
|
||||
|
Loading…
Reference in New Issue
Block a user