]> git.ipfire.org Git - thirdparty/bootstrap.git/commitdiff
Toast: join multiple classList calls (#35507)
authorXhmikosR <xhmikosr@gmail.com>
Fri, 10 Dec 2021 05:42:08 +0000 (07:42 +0200)
committerGitHub <noreply@github.com>
Fri, 10 Dec 2021 05:42:08 +0000 (07:42 +0200)
js/src/toast.js

index c45721c8f86307f0899275c5a1016dd8a7b97ed2..ba376d05edb3e1fabaf2c7c73b641574f0fb6cf5 100644 (file)
@@ -5,11 +5,7 @@
  * --------------------------------------------------------------------------
  */
 
-import {
-  defineJQueryPlugin,
-  reflow,
-  typeCheckConfig
-} from './util/index'
+import { defineJQueryPlugin, reflow, typeCheckConfig } from './util/index'
 import EventHandler from './dom/event-handler'
 import Manipulator from './dom/manipulator'
 import BaseComponent from './base-component'
@@ -100,8 +96,7 @@ class Toast extends BaseComponent {
 
     this._element.classList.remove(CLASS_NAME_HIDE) // @deprecated
     reflow(this._element)
-    this._element.classList.add(CLASS_NAME_SHOW)
-    this._element.classList.add(CLASS_NAME_SHOWING)
+    this._element.classList.add(CLASS_NAME_SHOW, CLASS_NAME_SHOWING)
 
     this._queueCallback(complete, this._element, this._config.animation)
   }
@@ -119,8 +114,7 @@ class Toast extends BaseComponent {
 
     const complete = () => {
       this._element.classList.add(CLASS_NAME_HIDE) // @deprecated
-      this._element.classList.remove(CLASS_NAME_SHOWING)
-      this._element.classList.remove(CLASS_NAME_SHOW)
+      this._element.classList.remove(CLASS_NAME_SHOWING, CLASS_NAME_SHOW)
       EventHandler.trigger(this._element, EVENT_HIDDEN)
     }