nopaque/app/static/js/forms/create-contribution-form.js
2023-10-05 16:08:04 +02:00

19 lines
613 B
JavaScript

Forms.CreateContributionForm = class CreateContributionForm extends Forms.BaseForm {
static autoInit() {
let createContributionFormElements = document.querySelectorAll('.create-contribution-form');
for (let createContributionFormElement of createContributionFormElements) {
new Forms.CreateContributionForm(createContributionFormElement);
}
}
constructor(formElement) {
super(formElement);
this.addEventListener('requestLoad', (event) => {
if (event.target.status === 201) {
window.location.href = event.target.getResponseHeader('Location');
}
});
}
};