X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=src%2Fjquery%2Fjquery.js;h=2ddb919cc506a4ba2746da66d1cbf72e07b9543b;hb=688c724b1f07b3e0ca7cb27b1d9f76b7b11959ce;hp=31dde991d5e41b11f5f1a090444a51d9b05b7f40;hpb=af961d58c244224c14f3bb519214485cb670c64d;p=jquery.git diff --git a/src/jquery/jquery.js b/src/jquery/jquery.js index 31dde99..2ddb919 100644 --- a/src/jquery/jquery.js +++ b/src/jquery/jquery.js @@ -28,7 +28,7 @@ window.undefined = window.undefined; * @name jQuery * @cat Core */ -function jQuery(a,c) { +var jQuery = function(a,c) { // Shortcut for document ready (because $(document).each() is silly) if ( a && typeof a == "function" && jQuery.fn.ready ) @@ -71,7 +71,7 @@ function jQuery(a,c) { this.each(fn); return this; -} +}; // Map over the $ in case of overwrite if ( typeof $ != "undefined" ) @@ -1297,8 +1297,17 @@ jQuery.fn = jQuery.prototype = { * @cat Javascript */ jQuery.extend = jQuery.fn.extend = function(obj,prop) { + // Watch for the case where null or undefined gets passed in by accident + if ( arguments.length > 1 && (prop === null || prop == undefined) ) + return obj; + + // If no property object was provided, then we're extending jQuery if ( !prop ) { prop = obj; obj = this; } + + // Extend the base object for ( var i in prop ) obj[i] = prop[i]; + + // Return the modified object return obj; }; @@ -1492,6 +1501,9 @@ jQuery.extend({ } else if (document.defaultView && document.defaultView.getComputedStyle) { + if (prop == "cssFloat" || prop == "styleFloat") + prop = "float"; + prop = prop.replace(/([A-Z])/g,"-$1").toLowerCase(); var cur = document.defaultView.getComputedStyle(elem, null);