From 74460f09e1dd4c1ec8da115a359ea89b42c7eff0 Mon Sep 17 00:00:00 2001 From: cdrani Date: Wed, 29 May 2024 03:04:51 -0600 Subject: [PATCH] fix: reset selected reverb effect bg on hide --- src/models/reverb/reverb-controller.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/models/reverb/reverb-controller.js b/src/models/reverb/reverb-controller.js index 89ef9943..f47be15f 100644 --- a/src/models/reverb/reverb-controller.js +++ b/src/models/reverb/reverb-controller.js @@ -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 @@ -47,6 +54,7 @@ export default class ReverbController { if (list.style.display !== 'flex') return + this.#resetBtnBackgrounds() this.#highlightFirstVisibleBtn({ isRoom, effectList: list }) }