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

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

Merged
merged 3 commits into from
Apr 9, 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
7 changes: 2 additions & 5 deletions js/src/carousel.js
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
6 changes: 2 additions & 4 deletions js/src/collapse.js
Original file line number Diff line number Diff line change
Expand Up @@ -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] = ''

Expand Down Expand Up @@ -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) {
Expand Down
3 changes: 1 addition & 2 deletions js/src/popover.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
3 changes: 1 addition & 2 deletions js/src/tooltip.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down