Commit 37c801ed authored by Rick Waldron's avatar Rick Waldron

Fixes #13566. If there is a window object, define jQuery and $

Signed-off-by: 's avatarRick Waldron <waldron.rick@gmail.com>
parent 32b066d3
...@@ -5,9 +5,6 @@ if ( typeof module === "object" && typeof module.exports === "object" ) { ...@@ -5,9 +5,6 @@ if ( typeof module === "object" && typeof module.exports === "object" ) {
// upon in the Node module world. // upon in the Node module world.
module.exports = jQuery; module.exports = jQuery;
} else { } else {
// Otherwise expose jQuery to the global object as usual
window.jQuery = window.$ = jQuery;
// Register as a named AMD module, since jQuery can be concatenated with other // Register as a named AMD module, since jQuery can be concatenated with other
// files that may use define, but not via a proper concatenation script that // files that may use define, but not via a proper concatenation script that
// understands anonymous AMD modules. A named AMD is safest and most robust // understands anonymous AMD modules. A named AMD is safest and most robust
...@@ -19,3 +16,8 @@ if ( typeof module === "object" && typeof module.exports === "object" ) { ...@@ -19,3 +16,8 @@ if ( typeof module === "object" && typeof module.exports === "object" ) {
define( "jquery", [], function () { return jQuery; } ); define( "jquery", [], function () { return jQuery; } );
} }
} }
// If there is a window object, define a jQuery and $
if ( typeof window === "object" ) {
window.jQuery = window.$ = jQuery;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment