From a48858382ad212fb32c8c8f6dc1d2cd954a40a43 Mon Sep 17 00:00:00 2001 From: Trevor Parscal Date: Tue, 5 Oct 2010 21:51:24 +0000 Subject: [PATCH] Fixed jQuery bug/enahnced jQuery to not blindly convert anything that's not a string to an integer and append 'px', resulting in values like "nullpx" and "NaNpx" which would cause errors in Internet Explorer. Now we are using ( parseInt( size ) || 0 ) + "px" so that if size is null or NaN it will be converted to 0. I've also passed this upstream (http://dev.jquery.com/ticket/7116) --- resources/jquery/jquery.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/jquery/jquery.js b/resources/jquery/jquery.js index fff6776433..27456efd56 100644 --- a/resources/jquery/jquery.js +++ b/resources/jquery/jquery.js @@ -6230,7 +6230,7 @@ jQuery.each([ "Height", "Width" ], function( i, name ) { jQuery.css( elem, type ) : // Set the width or height on the element (default to pixels if value is unitless) - this.css( type, typeof size === "string" ? size : size + "px" ); + this.css( type, typeof size === "string" ? size : ( parseInt( size ) || 0 ) + "px" ); }; }); -- 2.20.1