Added a fix for .noConflict(true) not reverting properly. Also added unit tests for...
[jquery.git] / src / core.js
index 3aea325..7b97646 100644 (file)
@@ -10,8 +10,8 @@
  */\r
 \r
 // Map over jQuery in case of overwrite\r
-if ( typeof jQuery != "undefined" )\r
-       var _jQuery = jQuery;\r
+if ( window.jQuery )\r
+       var _jQuery = window.jQuery;\r
 \r
 var jQuery = window.jQuery = function( selector, context ) {\r
        // If the context is a namespace object, return a new object\r
@@ -21,8 +21,8 @@ var jQuery = window.jQuery = function( selector, context ) {
 };\r
 \r
 // Map over the $ in case of overwrite\r
-if ( typeof $ != "undefined" )\r
-       var _$ = $;\r
+if ( window.$ )\r
+       var _$ = window.$;\r
        \r
 // Map the jQuery namespace to the '$' one\r
 window.$ = jQuery;\r
@@ -1296,7 +1296,7 @@ jQuery.each([ "Height", "Width" ], function(i, name){
                        jQuery.browser.opera && document.body[ "client" + name ] || \r
                        \r
                        // Safari reports inner[Width/Height] just fine (Mozilla and Opera include scroll bar widths)\r
-                       jQuery.browser.safari && self[ "inner" + name ] ||\r
+                       jQuery.browser.safari && window[ "inner" + name ] ||\r
                        \r
                        // Everyone else use document.documentElement or document.body depending on Quirks vs Standards mode\r
                        document.compatMode == "CSS1Compat" && document.documentElement[ "client" + name ] || document.body[ "client" + name ] :\r