Commit b6dd1c67 authored by jrburke's avatar jrburke Committed by Dave Methvin

Remove the define.amd.jQuery check, close gh-1150.

Cherry picked from 2.0 master 34c4e122

Conflicts:
	src/exports.js
parent 937b2b19
...@@ -18,6 +18,7 @@ ...@@ -18,6 +18,7 @@
"predef": [ "predef": [
"define", "define",
"module",
"jQuery" "jQuery"
] ]
} }
// Expose jQuery to the global object if ( typeof module === "object" && typeof module.exports === "object" ) {
window.jQuery = window.$ = jQuery; // Expose jQuery as module.exports in loaders that implement the Node
// module pattern (including browserify). Do not create the global, since
// the user will be storing it themselves locally, and globals are frowned
// upon in the Node module world.
module.exports = jQuery;
} else {
// Otherwise expose jQuery to the global object as usual
window.jQuery = window.$ = jQuery;
// Expose jQuery as an AMD module, but only for AMD loaders that // Register as a named AMD module, since jQuery can be concatenated with other
// understand the issues with loading multiple versions of jQuery // files that may use define, but not via a proper concatenation script that
// in a page that all might call define(). The loader will indicate // understands anonymous AMD modules. A named AMD is safest and most robust
// they have special allowances for multiple jQuery versions by // way to register. Lowercase jquery is used because AMD module names are
// specifying define.amd.jQuery = true. Register as a named module, // derived from file names, and jQuery is normally delivered in a lowercase
// since jQuery can be concatenated with other files that may use define, // file name. Do this after creating the global so that if an AMD module wants
// but not use a proper concatenation script that understands anonymous // to call noConflict to hide this version of jQuery, it will work.
// AMD modules. A named AMD is safest and most robust way to register. if ( typeof define === "function" && define.amd ) {
// Lowercase jquery is used because AMD module names are derived from
// file names, and jQuery is normally delivered in a lowercase file name.
// Do this after creating the global so that if an AMD module wants to call
// noConflict to hide this version of jQuery, it will work.
if ( typeof define === "function" && define.amd && define.amd.jQuery ) {
define( "jquery", [], function () { return jQuery; } ); define( "jquery", [], function () { return jQuery; } );
}
} }
...@@ -19,9 +19,7 @@ function define( name, dependencies, callback ) { ...@@ -19,9 +19,7 @@ function define( name, dependencies, callback ) {
amdDefined = callback(); amdDefined = callback();
} }
define.amd = { define.amd = {};
jQuery: true
};
/** /**
* Returns an array of elements with the given IDs * Returns an array of elements with the given IDs
......
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