X-Git-Url: http://git.asbjorn.it/?a=blobdiff_plain;f=src%2Ffx.js;h=d5185c58db2213a6d0f8f700b75f6f49206c5a1b;hb=d822c0c2140f8562f0bb7876b48a663ecef60176;hp=c613f938dad3dbe58fa5ad328067ccc6bb5c2f6e;hpb=b3ec8edddd9261eef490f8317144e9c68c888819;p=jquery.git diff --git a/src/fx.js b/src/fx.js index c613f93..d5185c5 100644 --- 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(); @@ -32,7 +35,7 @@ jQuery.fn.extend({ toggle: function( fn, fn2 ){ return jQuery.isFunction(fn) && jQuery.isFunction(fn2) ? - this._toggle( fn, fn2 ) : + this._toggle.apply( this, arguments ) : fn ? this.animate({ height: "toggle", width: "toggle", opacity: "toggle" @@ -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 { @@ -181,15 +181,14 @@ jQuery.fn.extend({ var queue = function( elem, type, array ) { if ( !elem ) - return; + return undefined; type = type || "fx"; 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; }; @@ -418,4 +417,4 @@ jQuery.fx.step = { _default: function(fx){ fx.elem.style[ fx.prop ] = fx.now + fx.unit; } -}; \ No newline at end of file +};