mirror of
https://gitlab.ub.uni-bielefeld.de/sfb1288inf/nopaque.git
synced 2024-12-27 20:04:17 +00:00
19 lines
565 B
JavaScript
19 lines
565 B
JavaScript
|
class CreateContributionForm extends Form {
|
||
|
static autoInit() {
|
||
|
let createContributionFormElements = document.querySelectorAll('.create-contribution-form');
|
||
|
for (let createContributionFormElement of createContributionFormElements) {
|
||
|
new CreateContributionForm(createContributionFormElement);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
constructor(formElement) {
|
||
|
super(formElement);
|
||
|
|
||
|
this.addEventListener('requestLoad', (event) => {
|
||
|
if (event.target.status === 201) {
|
||
|
window.location.href = event.target.getResponseHeader('Location');
|
||
|
}
|
||
|
});
|
||
|
}
|
||
|
}
|