Optimize classList.remove()

This commit is contained in:
redphx 2024-01-15 16:45:12 +07:00
parent 7271478ebc
commit 4add599f8e

View File

@ -3485,8 +3485,7 @@ class Toast {
}
const classList = Toast.#$wrapper.classList;
classList.remove('bx-offscreen');
classList.remove('bx-hide');
classList.remove('bx-offscreen', 'bx-hide');
classList.add('bx-show');
}
@ -3506,8 +3505,7 @@ class Toast {
Toast.#$wrapper.addEventListener('transitionend', e => {
const classList = Toast.#$wrapper.classList;
if (classList.contains('bx-hide')) {
classList.remove('bx-show');
classList.remove('bx-hide');
classList.remove('bx-offscreen', 'bx-hide');
classList.add('bx-offscreen');
}
});