diff options
| author | Johann-S <[email protected]> | 2017-08-24 20:50:27 +0200 |
|---|---|---|
| committer | XhmikosR <[email protected]> | 2019-02-20 22:05:45 +0200 |
| commit | 3664d14908911c803e15300f90b0659a67341f97 (patch) | |
| tree | f678d339c372f186997e138511094c830592fbd9 /js/src | |
| parent | 4aef395e49a5418b9eec849dc1eb5ab1a180db4e (diff) | |
| download | bootstrap-3664d14908911c803e15300f90b0659a67341f97.tar.xz bootstrap-3664d14908911c803e15300f90b0659a67341f97.zip | |
fix declaration of alert jquery plugin only if jquery is available
Diffstat (limited to 'js/src')
| -rw-r--r-- | js/src/alert.js | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/js/src/alert.js b/js/src/alert.js index 000d7506f..d23c4659c 100644 --- a/js/src/alert.js +++ b/js/src/alert.js @@ -21,7 +21,6 @@ const VERSION = '4.3.1' const DATA_KEY = 'bs.alert' const EVENT_KEY = `.${DATA_KEY}` const DATA_API_KEY = '.data-api' -const JQUERY_NO_CONFLICT = $.fn[NAME] const Selector = { DISMISS : '[data-dismiss="alert"]' @@ -152,10 +151,11 @@ EventHandler.on(document, Event.CLICK_DATA_API, Selector.DISMISS, Alert._handleD */ if (typeof window.$ !== 'undefined' || typeof window.jQuery !== 'undefined') { - const $ = window.$ || window.jQuery - $.fn[NAME] = Alert._jQueryInterface - $.fn[NAME].Constructor = Alert - $.fn[NAME].noConflict = () => { + const $ = window.$ || window.jQuery + const JQUERY_NO_CONFLICT = $.fn[NAME] + $.fn[NAME] = Alert._jQueryInterface + $.fn[NAME].Constructor = Alert + $.fn[NAME].noConflict = () => { $.fn[NAME] = JQUERY_NO_CONFLICT return Alert._jQueryInterface } |
