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

Remove TRANSITION_END from utils #32394

Merged
merged 4 commits into from Dec 10, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 1 addition & 2 deletions js/src/alert.js
Expand Up @@ -7,7 +7,6 @@

import {
defineJQueryPlugin,
TRANSITION_END,
emulateTransitionEnd,
getElementFromSelector,
getTransitionDurationFromElement
Expand Down Expand Up @@ -83,7 +82,7 @@ class Alert extends BaseComponent {

const transitionDuration = getTransitionDurationFromElement(element)

EventHandler.one(element, TRANSITION_END, () => this._destroyElement(element))
EventHandler.one(element, 'transitionend', () => this._destroyElement(element))
emulateTransitionEnd(element, transitionDuration)
}

Expand Down
3 changes: 1 addition & 2 deletions js/src/carousel.js
Expand Up @@ -7,7 +7,6 @@

import {
defineJQueryPlugin,
TRANSITION_END,
emulateTransitionEnd,
getElementFromSelector,
getTransitionDurationFromElement,
Expand Down Expand Up @@ -480,7 +479,7 @@ class Carousel extends BaseComponent {

const transitionDuration = getTransitionDurationFromElement(activeElement)

EventHandler.one(activeElement, TRANSITION_END, () => {
EventHandler.one(activeElement, 'transitionend', () => {
nextElement.classList.remove(directionalClassName, orderClassName)
nextElement.classList.add(CLASS_NAME_ACTIVE)

Expand Down
5 changes: 2 additions & 3 deletions js/src/collapse.js
Expand Up @@ -7,7 +7,6 @@

import {
defineJQueryPlugin,
TRANSITION_END,
emulateTransitionEnd,
getSelectorFromElement,
getElementFromSelector,
Expand Down Expand Up @@ -203,7 +202,7 @@ class Collapse extends BaseComponent {
const scrollSize = `scroll${capitalizedDimension}`
const transitionDuration = getTransitionDurationFromElement(this._element)

EventHandler.one(this._element, TRANSITION_END, complete)
EventHandler.one(this._element, 'transitionend', complete)

emulateTransitionEnd(this._element, transitionDuration)
this._element.style[dimension] = `${this._element[scrollSize]}px`
Expand Down Expand Up @@ -253,7 +252,7 @@ class Collapse extends BaseComponent {
this._element.style[dimension] = ''
const transitionDuration = getTransitionDurationFromElement(this._element)

EventHandler.one(this._element, TRANSITION_END, complete)
EventHandler.one(this._element, 'transitionend', complete)
emulateTransitionEnd(this._element, transitionDuration)
}

Expand Down
15 changes: 7 additions & 8 deletions js/src/modal.js
Expand Up @@ -7,7 +7,6 @@

import {
defineJQueryPlugin,
TRANSITION_END,
emulateTransitionEnd,
getElementFromSelector,
getTransitionDurationFromElement,
Expand Down Expand Up @@ -184,7 +183,7 @@ class Modal extends BaseComponent {
if (transition) {
const transitionDuration = getTransitionDurationFromElement(this._element)

EventHandler.one(this._element, TRANSITION_END, event => this._hideModal(event))
EventHandler.one(this._element, 'transitionend', event => this._hideModal(event))
emulateTransitionEnd(this._element, transitionDuration)
} else {
this._hideModal()
Expand Down Expand Up @@ -272,7 +271,7 @@ class Modal extends BaseComponent {
if (transition) {
const transitionDuration = getTransitionDurationFromElement(this._dialog)

EventHandler.one(this._dialog, TRANSITION_END, transitionComplete)
EventHandler.one(this._dialog, 'transitionend', transitionComplete)
emulateTransitionEnd(this._dialog, transitionDuration)
} else {
transitionComplete()
Expand Down Expand Up @@ -377,7 +376,7 @@ class Modal extends BaseComponent {

const backdropTransitionDuration = getTransitionDurationFromElement(this._backdrop)

EventHandler.one(this._backdrop, TRANSITION_END, callback)
EventHandler.one(this._backdrop, 'transitionend', callback)
emulateTransitionEnd(this._backdrop, backdropTransitionDuration)
} else if (!this._isShown && this._backdrop) {
this._backdrop.classList.remove(CLASS_NAME_SHOW)
Expand All @@ -389,7 +388,7 @@ class Modal extends BaseComponent {

if (this._element.classList.contains(CLASS_NAME_FADE)) {
const backdropTransitionDuration = getTransitionDurationFromElement(this._backdrop)
EventHandler.one(this._backdrop, TRANSITION_END, callbackRemove)
EventHandler.one(this._backdrop, 'transitionend', callbackRemove)
emulateTransitionEnd(this._backdrop, backdropTransitionDuration)
} else {
callbackRemove()
Expand All @@ -413,11 +412,11 @@ class Modal extends BaseComponent {

this._element.classList.add(CLASS_NAME_STATIC)
const modalTransitionDuration = getTransitionDurationFromElement(this._dialog)
EventHandler.off(this._element, TRANSITION_END)
EventHandler.one(this._element, TRANSITION_END, () => {
EventHandler.off(this._element, 'transitionend')
EventHandler.one(this._element, 'transitionend', () => {
this._element.classList.remove(CLASS_NAME_STATIC)
if (!isModalOverflowing) {
EventHandler.one(this._element, TRANSITION_END, () => {
EventHandler.one(this._element, 'transitionend', () => {
this._element.style.overflowY = ''
})
emulateTransitionEnd(this._element, modalTransitionDuration)
Expand Down
3 changes: 1 addition & 2 deletions js/src/tab.js
Expand Up @@ -7,7 +7,6 @@

import {
defineJQueryPlugin,
TRANSITION_END,
emulateTransitionEnd,
getElementFromSelector,
getTransitionDurationFromElement,
Expand Down Expand Up @@ -132,7 +131,7 @@ class Tab extends BaseComponent {
const transitionDuration = getTransitionDurationFromElement(active)
active.classList.remove(CLASS_NAME_SHOW)

EventHandler.one(active, TRANSITION_END, complete)
EventHandler.one(active, 'transitionend', complete)
emulateTransitionEnd(active, transitionDuration)
} else {
complete()
Expand Down
5 changes: 2 additions & 3 deletions js/src/toast.js
Expand Up @@ -7,7 +7,6 @@

import {
defineJQueryPlugin,
TRANSITION_END,
emulateTransitionEnd,
getTransitionDurationFromElement,
reflow,
Expand Down Expand Up @@ -116,7 +115,7 @@ class Toast extends BaseComponent {
if (this._config.animation) {
const transitionDuration = getTransitionDurationFromElement(this._element)

EventHandler.one(this._element, TRANSITION_END, complete)
EventHandler.one(this._element, 'transitionend', complete)
emulateTransitionEnd(this._element, transitionDuration)
} else {
complete()
Expand All @@ -143,7 +142,7 @@ class Toast extends BaseComponent {
if (this._config.animation) {
const transitionDuration = getTransitionDurationFromElement(this._element)

EventHandler.one(this._element, TRANSITION_END, complete)
EventHandler.one(this._element, 'transitionend', complete)
emulateTransitionEnd(this._element, transitionDuration)
} else {
complete()
Expand Down
5 changes: 2 additions & 3 deletions js/src/tooltip.js
Expand Up @@ -9,7 +9,6 @@ import * as Popper from '@popperjs/core'

import {
defineJQueryPlugin,
TRANSITION_END,
emulateTransitionEnd,
findShadowRoot,
getTransitionDurationFromElement,
Expand Down Expand Up @@ -317,7 +316,7 @@ class Tooltip extends BaseComponent {

if (this.tip.classList.contains(CLASS_NAME_FADE)) {
const transitionDuration = getTransitionDurationFromElement(this.tip)
EventHandler.one(this.tip, TRANSITION_END, complete)
EventHandler.one(this.tip, 'transitionend', complete)
emulateTransitionEnd(this.tip, transitionDuration)
} else {
complete()
Expand Down Expand Up @@ -367,7 +366,7 @@ class Tooltip extends BaseComponent {
if (this.tip.classList.contains(CLASS_NAME_FADE)) {
const transitionDuration = getTransitionDurationFromElement(tip)

EventHandler.one(tip, TRANSITION_END, complete)
EventHandler.one(tip, 'transitionend', complete)
emulateTransitionEnd(tip, transitionDuration)
} else {
complete()
Expand Down
1 change: 0 additions & 1 deletion js/src/util/index.js
Expand Up @@ -205,7 +205,6 @@ const defineJQueryPlugin = (name, plugin) => {
}

export {
TRANSITION_END,
getUID,
getSelectorFromElement,
getElementFromSelector,
Expand Down