2023-10-05 14:08:04 +00:00
|
|
|
Forms.CreateJobForm = class CreateJobForm extends Forms.BaseForm {
|
2023-10-09 12:21:31 +00:00
|
|
|
static htmlClass = 'create-job-form';
|
2022-09-02 10:56:59 +00:00
|
|
|
|
|
|
|
constructor(formElement) {
|
|
|
|
super(formElement);
|
|
|
|
|
|
|
|
let versionField = this.formElement.querySelector('#create-job-form-version');
|
|
|
|
versionField.addEventListener('change', (event) => {
|
|
|
|
let url = new URL(window.location.href);
|
|
|
|
url.search = `?version=${event.target.value}`;
|
|
|
|
window.location.href = url.toString();
|
|
|
|
});
|
|
|
|
|
|
|
|
this.addEventListener('requestLoad', (event) => {
|
|
|
|
if (event.target.status === 201) {
|
|
|
|
window.location.href = event.target.getResponseHeader('Location');
|
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
2023-10-05 14:08:04 +00:00
|
|
|
};
|