mirror of
https://gitlab.ub.uni-bielefeld.de/sfb1288inf/nopaque.git
synced 2024-11-15 17:25:44 +00:00
43 lines
1.3 KiB
JavaScript
43 lines
1.3 KiB
JavaScript
|
function jobFormChangeHandler() {
|
||
|
if (jobFormFileElement.files.length === 0 || jobFormLanguageElement.value === "" || jobFormNameElement.value === "") {
|
||
|
jobFormSubmitElement.classList.add("disabled");
|
||
|
} else {
|
||
|
jobFormSubmitElement.classList.remove("disabled");
|
||
|
}
|
||
|
}
|
||
|
|
||
|
|
||
|
function jobFormSubmitHandler() {
|
||
|
createJob(jobFormFileElement.files[0], jobFormLanguageElement.value, jobFormNameElement.value, jobFormServiceElement.value, user["id"]);
|
||
|
}
|
||
|
|
||
|
|
||
|
var jobFormElement;
|
||
|
var jobFormFileElement;
|
||
|
var jobFormLanguageElement;
|
||
|
var jobFormNameElement;
|
||
|
var jobFormServiceElement;
|
||
|
var jobFormSubmitElement;
|
||
|
|
||
|
|
||
|
jobFormElement = document.getElementById("job_form");
|
||
|
jobFormFileElement = document.getElementById("job_form_file");
|
||
|
jobFormLanguageElement = document.getElementById("job_form_language");
|
||
|
jobFormNameElement = document.getElementById("job_form_name");
|
||
|
jobFormServiceElement = document.getElementById("job_form_service");
|
||
|
jobFormSubmitElement = document.getElementById("job_form_submit");
|
||
|
|
||
|
|
||
|
jobFormFileElement.addEventListener("change", jobFormChangeHandler);
|
||
|
jobFormLanguageElement.addEventListener("change", jobFormChangeHandler);
|
||
|
jobFormNameElement.addEventListener("input", jobFormChangeHandler);
|
||
|
|
||
|
M.Modal.init(
|
||
|
document.getElementById("create_job"),
|
||
|
{
|
||
|
"onCloseEnd": modal => {
|
||
|
jobFormElement.reset();
|
||
|
M.updateTextFields();
|
||
|
}
|
||
|
}
|
||
|
);
|