mirror of https://github.com/twbs/bootstrap.git
alert: rename variables for consistency (#32392)
This commit is contained in:
parent
41bc0e26d2
commit
0ca5addea4
|
|
@ -33,9 +33,9 @@ const EVENT_CLOSE = `close${EVENT_KEY}`
|
||||||
const EVENT_CLOSED = `closed${EVENT_KEY}`
|
const EVENT_CLOSED = `closed${EVENT_KEY}`
|
||||||
const EVENT_CLICK_DATA_API = `click${EVENT_KEY}${DATA_API_KEY}`
|
const EVENT_CLICK_DATA_API = `click${EVENT_KEY}${DATA_API_KEY}`
|
||||||
|
|
||||||
const CLASSNAME_ALERT = 'alert'
|
const CLASS_NAME_ALERT = 'alert'
|
||||||
const CLASSNAME_FADE = 'fade'
|
const CLASS_NAME_FADE = 'fade'
|
||||||
const CLASSNAME_SHOW = 'show'
|
const CLASS_NAME_SHOW = 'show'
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ------------------------------------------------------------------------
|
* ------------------------------------------------------------------------
|
||||||
|
|
@ -66,7 +66,7 @@ class Alert extends BaseComponent {
|
||||||
// Private
|
// Private
|
||||||
|
|
||||||
_getRootElement(element) {
|
_getRootElement(element) {
|
||||||
return getElementFromSelector(element) || element.closest(`.${CLASSNAME_ALERT}`)
|
return getElementFromSelector(element) || element.closest(`.${CLASS_NAME_ALERT}`)
|
||||||
}
|
}
|
||||||
|
|
||||||
_triggerCloseEvent(element) {
|
_triggerCloseEvent(element) {
|
||||||
|
|
@ -74,9 +74,9 @@ class Alert extends BaseComponent {
|
||||||
}
|
}
|
||||||
|
|
||||||
_removeElement(element) {
|
_removeElement(element) {
|
||||||
element.classList.remove(CLASSNAME_SHOW)
|
element.classList.remove(CLASS_NAME_SHOW)
|
||||||
|
|
||||||
if (!element.classList.contains(CLASSNAME_FADE)) {
|
if (!element.classList.contains(CLASS_NAME_FADE)) {
|
||||||
this._destroyElement(element)
|
this._destroyElement(element)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue