Further javascript improvements

This commit is contained in:
Patrick Jentsch
2023-10-05 16:08:04 +02:00
parent 7cae84ffdc
commit d3f2d5648e
7 changed files with 30 additions and 22 deletions

View File

@@ -0,0 +1,18 @@
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');
}
});
}
};