1
0
mirror of https://github.com/twbs/bootstrap.git synced 2025-09-27 13:59:06 +02:00

Comply to the new rules.

This commit is contained in:
XhmikosR
2019-02-26 13:20:34 +02:00
parent 44e6abcba5
commit 46c037410b
44 changed files with 854 additions and 771 deletions

View File

@@ -22,26 +22,26 @@ import SelectorEngine from './dom/selectorEngine'
* ------------------------------------------------------------------------
*/
const NAME = 'alert'
const VERSION = '4.3.1'
const DATA_KEY = 'bs.alert'
const EVENT_KEY = `.${DATA_KEY}`
const DATA_API_KEY = '.data-api'
const NAME = 'alert'
const VERSION = '4.3.1'
const DATA_KEY = 'bs.alert'
const EVENT_KEY = `.${DATA_KEY}`
const DATA_API_KEY = '.data-api'
const Selector = {
DISMISS : '[data-dismiss="alert"]'
DISMISS: '[data-dismiss="alert"]'
}
const Event = {
CLOSE : `close${EVENT_KEY}`,
CLOSED : `closed${EVENT_KEY}`,
CLICK_DATA_API : `click${EVENT_KEY}${DATA_API_KEY}`
CLOSE: `close${EVENT_KEY}`,
CLOSED: `closed${EVENT_KEY}`,
CLICK_DATA_API: `click${EVENT_KEY}${DATA_API_KEY}`
}
const ClassName = {
ALERT : 'alert',
FADE : 'fade',
SHOW : 'show'
ALERT: 'alert',
FADE: 'fade',
SHOW: 'show'
}
/**
@@ -90,7 +90,7 @@ class Alert {
_getRootElement(element) {
const selector = getSelectorFromElement(element)
let parent = false
let parent = false
if (selector) {
parent = SelectorEngine.findOne(selector)
@@ -118,7 +118,7 @@ class Alert {
const transitionDuration = getTransitionDurationFromElement(element)
EventHandler
.one(element, TRANSITION_END, (event) => this._destroyElement(element, event))
.one(element, TRANSITION_END, event => this._destroyElement(element, event))
emulateTransitionEnd(element, transitionDuration)
}
@@ -178,9 +178,9 @@ EventHandler
if (typeof $ !== 'undefined') {
const JQUERY_NO_CONFLICT = $.fn[NAME]
$.fn[NAME] = Alert._jQueryInterface
$.fn[NAME].Constructor = Alert
$.fn[NAME].noConflict = () => {
$.fn[NAME] = Alert._jQueryInterface
$.fn[NAME].Constructor = Alert
$.fn[NAME].noConflict = () => {
$.fn[NAME] = JQUERY_NO_CONFLICT
return Alert._jQueryInterface
}