From 8b2b490f9b58a02494fe8567d6ce5b9c11a9bf65 Mon Sep 17 00:00:00 2001 From: Johann-S Date: Fri, 2 Aug 2019 15:51:05 +0200 Subject: add a way to disable jQuery detection --- js/src/collapse/collapse.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'js/src/collapse') diff --git a/js/src/collapse/collapse.js b/js/src/collapse/collapse.js index 799085776..4de7b5282 100644 --- a/js/src/collapse/collapse.js +++ b/js/src/collapse/collapse.js @@ -6,7 +6,7 @@ */ import { - jQuery as $, + getjQuery, TRANSITION_END, emulateTransitionEnd, getSelectorFromElement, @@ -419,6 +419,8 @@ EventHandler.on(document, Event.CLICK_DATA_API, Selector.DATA_TOGGLE, function ( }) }) +const $ = getjQuery() + /** * ------------------------------------------------------------------------ * jQuery @@ -426,7 +428,7 @@ EventHandler.on(document, Event.CLICK_DATA_API, Selector.DATA_TOGGLE, function ( * add .collapse to jQuery only if jQuery is present */ /* istanbul ignore if */ -if (typeof $ !== 'undefined') { +if ($) { const JQUERY_NO_CONFLICT = $.fn[NAME] $.fn[NAME] = Collapse.jQueryInterface $.fn[NAME].Constructor = Collapse -- cgit v1.2.3