Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

alert: rename variables for consistency #32392

Merged
merged 2 commits into from
Dec 9, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions js/src/alert.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ const EVENT_CLOSE = `close${EVENT_KEY}`
const EVENT_CLOSED = `closed${EVENT_KEY}`
const EVENT_CLICK_DATA_API = `click${EVENT_KEY}${DATA_API_KEY}`

const CLASSNAME_ALERT = 'alert'
const CLASSNAME_FADE = 'fade'
const CLASSNAME_SHOW = 'show'
const CLASS_NAME_ALERT = 'alert'
const CLASS_NAME_FADE = 'fade'
const CLASS_NAME_SHOW = 'show'

/**
* ------------------------------------------------------------------------
Expand Down Expand Up @@ -66,17 +66,17 @@ class Alert extends BaseComponent {
// Private

_getRootElement(element) {
return getElementFromSelector(element) || element.closest(`.${CLASSNAME_ALERT}`)
return getElementFromSelector(element) || element.closest(`.${CLASS_NAME_ALERT}`)
}

_triggerCloseEvent(element) {
return EventHandler.trigger(element, EVENT_CLOSE)
}

_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)
return
}
Expand Down