]> source.dussan.org Git - jquery.git/commitdiff
Calling .hide().show() on a stylesheet-hidden element wasn't bringing it back. Fixes...
authorjeresig <jeresig@gmail.com>
Wed, 27 Oct 2010 18:35:26 +0000 (14:35 -0400)
committerjeresig <jeresig@gmail.com>
Wed, 27 Oct 2010 18:35:26 +0000 (14:35 -0400)
src/effects.js
test/unit/effects.js

index b73aa724740c3296bb39f3f38209728d786299e9..d87ba8f5d3a5d27bb393cb48b6de130977abf053 100644 (file)
@@ -28,7 +28,7 @@ jQuery.fn.extend({
                                // Reset the inline display of this element to learn if it is
                                // being hidden by cascaded rules or not
                                if ( !jQuery.data(elem, "olddisplay") && display === "none" ) {
-                                       elem.style.display = "";
+                                       display = elem.style.display = "";
                                }
 
                                // Set elements which have been overridden with display: none
index 0114b0f4c609821c18e16d4e628211fd1591babc..8facb4f54e1b9edec8076e46d5709e91f6d15123 100644 (file)
@@ -6,10 +6,18 @@ test("sanity check", function() {
 });
 
 test("show()", function() {
-       expect(26);
+       expect(27);
 
        var hiddendiv = jQuery("div.hidden");
 
+       hiddendiv.hide().show();
+
+       equals( hiddendiv.css("display"), "block", "Make sure a pre-hidden div is visible." );
+
+       QUnit.reset();
+
+       hiddendiv = jQuery("div.hidden");
+
        equal(jQuery.css( hiddendiv[0], "display"), "none", "hiddendiv is display: none");
 
        hiddendiv.css("display", "block");