mirror of
https://github.com/twbs/bootstrap.git
synced 2025-08-09 15:16:51 +02:00
fix declaration of alert jquery plugin only if jquery is available
This commit is contained in:
@@ -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"]'
|
||||||
@@ -153,6 +152,7 @@ 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
|
||||||
|
const JQUERY_NO_CONFLICT = $.fn[NAME]
|
||||||
$.fn[NAME] = Alert._jQueryInterface
|
$.fn[NAME] = Alert._jQueryInterface
|
||||||
$.fn[NAME].Constructor = Alert
|
$.fn[NAME].Constructor = Alert
|
||||||
$.fn[NAME].noConflict = () => {
|
$.fn[NAME].noConflict = () => {
|
||||||
|
Reference in New Issue
Block a user