- new simpler modal without bootstrap
- new loadingbutton component
- cleanupsome old code
- toolbar adjusments
This commit is contained in:
Jérémy Guillot
2024-06-30 12:44:41 +02:00
parent b4f0811bca
commit ba30d3102d
23 changed files with 403 additions and 302 deletions

View File

@@ -0,0 +1,21 @@
// assets/controllers/loading_button_controller.js
import {Controller} from "@hotwired/stimulus"
export default class extends Controller {
static targets = ["text", "loader"];
static values = {form: String};
startLoading(event) {
event.preventDefault();
this.textTarget.classList.add("hidden");
this.loaderTarget.classList.remove("hidden");
this.element.disabled = true;
if (this.hasFormValue) {
const form = document.getElementById(this.formValue);
if (form) {
form.submit();
}
}
}
}