Unverified Commit 9a5033d4 authored by XhmikosR's avatar XhmikosR Committed by GitHub
Browse files

Pass multiple classes to `classList.add` / `classList.remove` (#30537)

This is supported by our currently supported browsers.
parent 7126741f
Showing with 6 additions and 13 deletions
+6 -13
...@@ -478,13 +478,10 @@ class Carousel { ...@@ -478,13 +478,10 @@ class Carousel {
EventHandler EventHandler
.one(activeElement, TRANSITION_END, () => { .one(activeElement, TRANSITION_END, () => {
nextElement.classList.remove(directionalClassName) nextElement.classList.remove(directionalClassName, orderClassName)
nextElement.classList.remove(orderClassName)
nextElement.classList.add(CLASS_NAME_ACTIVE) nextElement.classList.add(CLASS_NAME_ACTIVE)
activeElement.classList.remove(CLASS_NAME_ACTIVE) activeElement.classList.remove(CLASS_NAME_ACTIVE, orderClassName, directionalClassName)
activeElement.classList.remove(orderClassName)
activeElement.classList.remove(directionalClassName)
this._isSliding = false this._isSliding = false
......
...@@ -192,8 +192,7 @@ class Collapse { ...@@ -192,8 +192,7 @@ class Collapse {
const complete = () => { const complete = () => {
this._element.classList.remove(CLASS_NAME_COLLAPSING) this._element.classList.remove(CLASS_NAME_COLLAPSING)
this._element.classList.add(CLASS_NAME_COLLAPSE) this._element.classList.add(CLASS_NAME_COLLAPSE, CLASS_NAME_SHOW)
this._element.classList.add(CLASS_NAME_SHOW)
this._element.style[dimension] = '' this._element.style[dimension] = ''
...@@ -230,8 +229,7 @@ class Collapse { ...@@ -230,8 +229,7 @@ class Collapse {
reflow(this._element) reflow(this._element)
this._element.classList.add(CLASS_NAME_COLLAPSING) this._element.classList.add(CLASS_NAME_COLLAPSING)
this._element.classList.remove(CLASS_NAME_COLLAPSE) this._element.classList.remove(CLASS_NAME_COLLAPSE, CLASS_NAME_SHOW)
this._element.classList.remove(CLASS_NAME_SHOW)
const triggerArrayLength = this._triggerArray.length const triggerArrayLength = this._triggerArray.length
if (triggerArrayLength > 0) { if (triggerArrayLength > 0) {
......
...@@ -113,8 +113,7 @@ class Popover extends Tooltip { ...@@ -113,8 +113,7 @@ class Popover extends Tooltip {
this.setElementContent(SelectorEngine.findOne(SELECTOR_CONTENT, tip), content) this.setElementContent(SelectorEngine.findOne(SELECTOR_CONTENT, tip), content)
tip.classList.remove(CLASS_NAME_FADE) tip.classList.remove(CLASS_NAME_FADE, CLASS_NAME_SHOW)
tip.classList.remove(CLASS_NAME_SHOW)
} }
_addAttachmentClass(attachment) { _addAttachmentClass(attachment) {
......
...@@ -400,8 +400,7 @@ class Tooltip { ...@@ -400,8 +400,7 @@ class Tooltip {
setContent() { setContent() {
const tip = this.getTipElement() const tip = this.getTipElement()
this.setElementContent(SelectorEngine.findOne(SELECTOR_TOOLTIP_INNER, tip), this.getTitle()) this.setElementContent(SelectorEngine.findOne(SELECTOR_TOOLTIP_INNER, tip), this.getTitle())
tip.classList.remove(CLASS_NAME_FADE) tip.classList.remove(CLASS_NAME_FADE, CLASS_NAME_SHOW)
tip.classList.remove(CLASS_NAME_SHOW)
} }
setElementContent(element, content) { setElementContent(element, content) {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment