jquery core: simplified the code using the new jQuery.makeArray from [5314] where...
[jquery.git] / src / fx.js
index fb564f0..824616a 100644 (file)
--- a/src/fx.js
+++ b/src/fx.js
@@ -10,6 +10,9 @@ jQuery.fn.extend({
                                if ( jQuery.css(this,"display") == "none" ) {
                                        var elem = jQuery("<" + this.tagName + " />").appendTo("body");
                                        this.style.display = elem.css("display");
+                                       // handle an edge condition where css is - div { display:none; } or similar
+                                       if (this.style.display == "none")
+                                               this.style.display = "block";
                                        elem.remove();
                                }
                        }).end();
@@ -139,9 +142,6 @@ jQuery.fn.extend({
                        return queue( this[0], type );
 
                return this.each(function(){
-                       if ( this.nodeType != 1)
-                               return;
-
                        if ( fn.constructor == Array )
                                queue(this, type, fn);
                        else {
@@ -188,8 +188,7 @@ var queue = function( elem, type, array ) {
        var q = jQuery.data( elem, type + "queue" );
 
        if ( !q || array )
-               q = jQuery.data( elem, type + "queue", 
-                       array ? jQuery.makeArray(array) : [] );
+               q = jQuery.data( elem, type + "queue", jQuery.makeArray(array) );
 
        return q;
 };