mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-24 20:36:49 +00:00
Yay, now it works. Not sure the best way to show loading yet. - currently the Turbo loading indicator shows which is better than nothing (blue bar at top) - ideally we could show a small spinner over the image thumbnail. need to write some stimulus to hook into turbo lifecycle I guess. - or we could activate the frame-level loading overlay. refactor loading_controller a bit so that it's applied on the container, then hopefully we can just call change->loading#showLoading. the turbo_stream response could dectivate it.
10 lines
329 B
JavaScript
10 lines
329 B
JavaScript
import { Controller } from "stimulus";
|
|
|
|
export default class FormController extends Controller {
|
|
submit() {
|
|
// Validate and submit the form, using the default submit button. Raises JS events.
|
|
// Ref: https://developer.mozilla.org/en-US/docs/Web/API/HTMLFormElement/requestSubmit
|
|
this.element.requestSubmit();
|
|
}
|
|
}
|