mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-24 20:36:49 +00:00
Allow communication between controllers via event
This commit is contained in:
@@ -30,6 +30,15 @@ export default class extends Controller {
|
||||
const tab_id = anchor.split("_panel").shift();
|
||||
this.updateActiveTab(tab_id);
|
||||
}
|
||||
|
||||
window.addEventListener("tabs-and-panels:click", (event) => {
|
||||
this.simulateClick(event.detail.tab, event.detail.panel);
|
||||
});
|
||||
}
|
||||
|
||||
simulateClick(tab, panel) {
|
||||
this.updateActiveTab(tab);
|
||||
this.updateActivePanel(panel);
|
||||
}
|
||||
|
||||
changeActivePanel(event) {
|
||||
|
||||
Reference in New Issue
Block a user