aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Rebert <[email protected]>2014-06-17 23:35:22 -0700
committerChris Rebert <[email protected]>2014-06-17 23:35:22 -0700
commit1c42dfcd532867acd1488de0d91edd71a6a19aea (patch)
tree8ab62efe13b461aa7a0c966030cec67401e7141b
parent4f95989c386a3ffd826c063909ec70d54443c944 (diff)
parentf347d7d955bbb17234b8e12c68efae7d516ce62c (diff)
downloadbootstrap-1c42dfcd532867acd1488de0d91edd71a6a19aea.tar.xz
bootstrap-1c42dfcd532867acd1488de0d91edd71a6a19aea.zip
Merge pull request #13842 from twbs/fix-13811
update "is jQuery defined" check for UMD compatibility
-rw-r--r--Gruntfile.js2
-rw-r--r--dist/js/bootstrap.js2
-rw-r--r--docs/assets/js/_src/customizer.js2
3 files changed, 3 insertions, 3 deletions
diff --git a/Gruntfile.js b/Gruntfile.js
index d78633156..922daf5e4 100644
--- a/Gruntfile.js
+++ b/Gruntfile.js
@@ -33,7 +33,7 @@ module.exports = function (grunt) {
' * Licensed under <%= pkg.license.type %> (<%= pkg.license.url %>)\n' +
' */\n',
// NOTE: This jqueryCheck code is duplicated in customizer.js; if making changes here, be sure to update the other copy too.
- jqueryCheck: 'if (typeof jQuery === \'undefined\') { throw new Error(\'Bootstrap\\\'s JavaScript requires jQuery\') }\n\n',
+ jqueryCheck: 'if (typeof define == \'undefined\' && typeof exports == \'undefined\' && typeof jQuery == \'undefined\') { throw new Error(\'Bootstrap\\\'s JavaScript requires jQuery\') }\n\n',
// Task configuration.
clean: {
diff --git a/dist/js/bootstrap.js b/dist/js/bootstrap.js
index f998f65af..b90519a24 100644
--- a/dist/js/bootstrap.js
+++ b/dist/js/bootstrap.js
@@ -4,7 +4,7 @@
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
*/
-if (typeof jQuery === 'undefined') { throw new Error('Bootstrap\'s JavaScript requires jQuery') }
+if (typeof define == 'undefined' && typeof exports == 'undefined' && typeof jQuery == 'undefined') { throw new Error('Bootstrap\'s JavaScript requires jQuery') }
/* ========================================================================
* Bootstrap: transition.js v3.1.1
diff --git a/docs/assets/js/_src/customizer.js b/docs/assets/js/_src/customizer.js
index 4fc3c7cbc..aec869797 100644
--- a/docs/assets/js/_src/customizer.js
+++ b/docs/assets/js/_src/customizer.js
@@ -306,7 +306,7 @@ window.onload = function () { // wait for load in a dumb way because B-0
function generateJS(preamble) {
var $checked = $('#plugin-section input:checked')
- var jqueryCheck = 'if (typeof jQuery === "undefined") { throw new Error("Bootstrap\'s JavaScript requires jQuery") }\n\n'
+ var jqueryCheck = 'if (typeof define == \'undefined\' && typeof exports == \'undefined\' && typeof jQuery == \'undefined\') { throw new Error(\'Bootstrap\\\'s JavaScript requires jQuery\') }\n\n'
if (!$checked.length) return false