mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-04-04 07:09:14 +00:00
Rename variables
To make it clear they are arrays
This commit is contained in:
committed by
Jean-Baptiste Bellet
parent
0fdf7876a6
commit
d03b88cf83
@@ -4,8 +4,8 @@ export default class extends Controller {
|
||||
static targets = ["arrow", "menu"];
|
||||
|
||||
connect() {
|
||||
this.collapsedClass = this.arrowTarget.dataset.collapsedClass.split(" ");
|
||||
this.expandedClass = this.arrowTarget.dataset.expandedClass.split(" ");
|
||||
this.collapsedClasses = this.arrowTarget.dataset.collapsedClass.split(" ");
|
||||
this.expandedClasses = this.arrowTarget.dataset.expandedClass.split(" ");
|
||||
this.#hide();
|
||||
document.addEventListener("click", this.#onBodyClick.bind(this));
|
||||
}
|
||||
@@ -33,12 +33,12 @@ export default class extends Controller {
|
||||
|
||||
#show() {
|
||||
this.menuTarget.classList.remove("hidden");
|
||||
this.arrowTarget.classList.remove(...this.collapsedClass);
|
||||
this.arrowTarget.classList.add(...this.expandedClass);
|
||||
this.arrowTarget.classList.remove(...this.collapsedClasses);
|
||||
this.arrowTarget.classList.add(...this.expandedClasses);
|
||||
}
|
||||
#hide() {
|
||||
this.menuTarget.classList.add("hidden");
|
||||
this.arrowTarget.classList.remove(...this.expandedClass);
|
||||
this.arrowTarget.classList.add(...this.collapsedClass);
|
||||
this.arrowTarget.classList.remove(...this.expandedClasses);
|
||||
this.arrowTarget.classList.add(...this.collapsedClasses);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user