mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-29 21:17:17 +00:00
Plus open modal when clicking on "preview" link. It's using event to communicate between stimulus controller : https://stimulus.hotwired.dev/reference/controllers#cross-controller-coordination-with-events
10 lines
251 B
JavaScript
10 lines
251 B
JavaScript
import { Controller } from "stimulus";
|
|
|
|
export default class extends Controller {
|
|
open() {
|
|
// dispatch "product-preview:open" event to trigger modal->open action
|
|
// see views/admin/product_v3/index.html.haml
|
|
this.dispatch("open");
|
|
}
|
|
}
|