Skip to content

Commit

Permalink
fix: reset selected reverb effect bg on hide
Browse files Browse the repository at this point in the history
  • Loading branch information
cdrani committed May 29, 2024
1 parent e58745d commit 74460f0
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/models/reverb/reverb-controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,13 @@ export default class ReverbController {
selectedBtn.style.background = '#3e3d3d'
}

#resetBtnBackgrounds() {
const { roomList, convolverList } = this.elements
const reset = (btn) => (btn.style.background = '#171717')
;[...roomList.children].forEach(reset)
;[...convolverList.children].forEach(reset)
}

#toggleListView = (e) => {
e.preventDefault()
const { roomList, convolverList } = this.elements
Expand All @@ -47,6 +54,7 @@ export default class ReverbController {

if (list.style.display !== 'flex') return

this.#resetBtnBackgrounds()
this.#highlightFirstVisibleBtn({ isRoom, effectList: list })
}

Expand Down

0 comments on commit 74460f0

Please sign in to comment.