mirror of
https://gitlab.ub.uni-bielefeld.de/sfb1288inf/nopaque.git
synced 2025-10-15 19:21:57 +00:00
Further javascript improvements
This commit is contained in:
18
app/static/js/forms/create-contribution-form.js
Normal file
18
app/static/js/forms/create-contribution-form.js
Normal 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');
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
Reference in New Issue
Block a user