0
0
mirror of https://github.com/twbs/bootstrap.git synced 2025-01-18 10:52:19 +01:00

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

This is supported by our currently supported browsers.
This commit is contained in:
XhmikosR 2020-04-09 20:56:43 +03:00 committed by GitHub
parent 7126741ffb
commit 9a5033d413
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 6 additions and 13 deletions

View File

@ -478,13 +478,10 @@ class Carousel {
EventHandler
.one(activeElement, TRANSITION_END, () => {
nextElement.classList.remove(directionalClassName)
nextElement.classList.remove(orderClassName)
nextElement.classList.remove(directionalClassName, orderClassName)
nextElement.classList.add(CLASS_NAME_ACTIVE)
activeElement.classList.remove(CLASS_NAME_ACTIVE)
activeElement.classList.remove(orderClassName)
activeElement.classList.remove(directionalClassName)
activeElement.classList.remove(CLASS_NAME_ACTIVE, orderClassName, directionalClassName)
this._isSliding = false

View File

@ -192,8 +192,7 @@ class Collapse {
const complete = () => {
this._element.classList.remove(CLASS_NAME_COLLAPSING)
this._element.classList.add(CLASS_NAME_COLLAPSE)
this._element.classList.add(CLASS_NAME_SHOW)
this._element.classList.add(CLASS_NAME_COLLAPSE, CLASS_NAME_SHOW)
this._element.style[dimension] = ''
@ -230,8 +229,7 @@ class Collapse {
reflow(this._element)
this._element.classList.add(CLASS_NAME_COLLAPSING)
this._element.classList.remove(CLASS_NAME_COLLAPSE)
this._element.classList.remove(CLASS_NAME_SHOW)
this._element.classList.remove(CLASS_NAME_COLLAPSE, CLASS_NAME_SHOW)
const triggerArrayLength = this._triggerArray.length
if (triggerArrayLength > 0) {

View File

@ -113,8 +113,7 @@ class Popover extends Tooltip {
this.setElementContent(SelectorEngine.findOne(SELECTOR_CONTENT, tip), content)
tip.classList.remove(CLASS_NAME_FADE)
tip.classList.remove(CLASS_NAME_SHOW)
tip.classList.remove(CLASS_NAME_FADE, CLASS_NAME_SHOW)
}
_addAttachmentClass(attachment) {

View File

@ -400,8 +400,7 @@ class Tooltip {
setContent() {
const tip = this.getTipElement()
this.setElementContent(SelectorEngine.findOne(SELECTOR_TOOLTIP_INNER, tip), this.getTitle())
tip.classList.remove(CLASS_NAME_FADE)
tip.classList.remove(CLASS_NAME_SHOW)
tip.classList.remove(CLASS_NAME_FADE, CLASS_NAME_SHOW)
}
setElementContent(element, content) {