Commit 3664d149 authored by Johann-S's avatar Johann-S Committed by XhmikosR
Browse files

fix declaration of alert jquery plugin only if jquery is available

parent 4aef395e
5 merge requests!31948Examples/Floating-labels: fix bad behavior with autofill,!30064test,!29779Responsive sizing,!28882fix custom-select-indicator in IE10,!28721Hot test
Showing with 5 additions and 5 deletions
+5 -5
...@@ -21,7 +21,6 @@ const VERSION = '4.3.1' ...@@ -21,7 +21,6 @@ const VERSION = '4.3.1'
const DATA_KEY = 'bs.alert' const DATA_KEY = 'bs.alert'
const EVENT_KEY = `.${DATA_KEY}` const EVENT_KEY = `.${DATA_KEY}`
const DATA_API_KEY = '.data-api' const DATA_API_KEY = '.data-api'
const JQUERY_NO_CONFLICT = $.fn[NAME]
const Selector = { const Selector = {
DISMISS : '[data-dismiss="alert"]' DISMISS : '[data-dismiss="alert"]'
...@@ -152,10 +151,11 @@ EventHandler.on(document, Event.CLICK_DATA_API, Selector.DISMISS, Alert._handleD ...@@ -152,10 +151,11 @@ EventHandler.on(document, Event.CLICK_DATA_API, Selector.DISMISS, Alert._handleD
*/ */
if (typeof window.$ !== 'undefined' || typeof window.jQuery !== 'undefined') { if (typeof window.$ !== 'undefined' || typeof window.jQuery !== 'undefined') {
const $ = window.$ || window.jQuery const $ = window.$ || window.jQuery
$.fn[NAME] = Alert._jQueryInterface const JQUERY_NO_CONFLICT = $.fn[NAME]
$.fn[NAME].Constructor = Alert $.fn[NAME] = Alert._jQueryInterface
$.fn[NAME].noConflict = () => { $.fn[NAME].Constructor = Alert
$.fn[NAME].noConflict = () => {
$.fn[NAME] = JQUERY_NO_CONFLICT $.fn[NAME] = JQUERY_NO_CONFLICT
return Alert._jQueryInterface return Alert._jQueryInterface
} }
......
Supports Markdown
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