aboutsummaryrefslogtreecommitdiff
path: root/js/src/dropdown
diff options
context:
space:
mode:
authorJohann-S <[email protected]>2019-08-02 15:51:05 +0200
committerJohann-S <[email protected]>2019-08-02 16:50:05 +0200
commit8b2b490f9b58a02494fe8567d6ce5b9c11a9bf65 (patch)
treefca5d7d55bb5f2932eda48f4594b4a839b0a8987 /js/src/dropdown
parent1ebb8e7d9b4bd52c7fc088aeaec12ab9bcb240c6 (diff)
downloadbootstrap-8b2b490f9b58a02494fe8567d6ce5b9c11a9bf65.tar.xz
bootstrap-8b2b490f9b58a02494fe8567d6ce5b9c11a9bf65.zip
add a way to disable jQuery detection
Diffstat (limited to 'js/src/dropdown')
-rw-r--r--js/src/dropdown/dropdown.js6
1 files changed, 4 insertions, 2 deletions
diff --git a/js/src/dropdown/dropdown.js b/js/src/dropdown/dropdown.js
index 7f5264d05..2c30ba740 100644
--- a/js/src/dropdown/dropdown.js
+++ b/js/src/dropdown/dropdown.js
@@ -6,7 +6,7 @@
*/
import {
- jQuery as $,
+ getjQuery,
getElementFromSelector,
isElement,
makeArray,
@@ -526,6 +526,8 @@ EventHandler.on(document, Event.CLICK_DATA_API, Selector.DATA_TOGGLE, function (
EventHandler
.on(document, Event.CLICK_DATA_API, Selector.FORM_CHILD, e => e.stopPropagation())
+const $ = getjQuery()
+
/**
* ------------------------------------------------------------------------
* jQuery
@@ -533,7 +535,7 @@ EventHandler
* add .dropdown to jQuery only if jQuery is present
*/
/* istanbul ignore if */
-if (typeof $ !== 'undefined') {
+if ($) {
const JQUERY_NO_CONFLICT = $.fn[NAME]
$.fn[NAME] = Dropdown.jQueryInterface
$.fn[NAME].Constructor = Dropdown