2023-10-05 16:08:04 +02:00
|
|
|
Forms.CreateContributionForm = class CreateContributionForm extends Forms.BaseForm {
|
2022-11-03 15:38:35 +01:00
|
|
|
static autoInit() {
|
|
|
|
let createContributionFormElements = document.querySelectorAll('.create-contribution-form');
|
|
|
|
for (let createContributionFormElement of createContributionFormElements) {
|
2023-10-05 16:08:04 +02:00
|
|
|
new Forms.CreateContributionForm(createContributionFormElement);
|
2022-11-03 15:38:35 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
constructor(formElement) {
|
|
|
|
super(formElement);
|
|
|
|
|
|
|
|
this.addEventListener('requestLoad', (event) => {
|
|
|
|
if (event.target.status === 201) {
|
|
|
|
window.location.href = event.target.getResponseHeader('Location');
|
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
2023-10-05 16:08:04 +02:00
|
|
|
};
|