2018-10-09 11:43:51 +02:00
|
|
|
import { show, hide } from '@utils';
|
2018-08-09 11:53:59 +02:00
|
|
|
|
2018-09-13 17:13:09 +02:00
|
|
|
export function showMotivation(event, state) {
|
|
|
|
event.preventDefault();
|
2019-04-10 10:32:43 +02:00
|
|
|
motivationCancel();
|
2023-02-28 10:49:50 +01:00
|
|
|
const stateElement = document.querySelector(`.motivation.${state}`);
|
2023-02-27 17:05:39 +01:00
|
|
|
|
|
|
|
show(stateElement.parentElement);
|
|
|
|
show(stateElement);
|
2018-10-09 11:43:51 +02:00
|
|
|
hide(document.querySelector('.dropdown-items'));
|
2018-07-12 11:50:47 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
export function motivationCancel() {
|
2018-10-09 11:43:51 +02:00
|
|
|
document.querySelectorAll('.motivation').forEach(hide);
|
2023-02-28 10:49:50 +01:00
|
|
|
document
|
|
|
|
.querySelectorAll('.motivation')
|
|
|
|
.forEach((el) => hide(el.parentElement));
|
2023-02-27 17:05:39 +01:00
|
|
|
|
2018-10-09 11:43:51 +02:00
|
|
|
show(document.querySelector('.dropdown-items'));
|
2023-03-27 17:21:35 +02:00
|
|
|
|
|
|
|
document.querySelectorAll('.js_delete_motivation').forEach(hide);
|
|
|
|
}
|
|
|
|
|
|
|
|
export function motivationCancelBatch() {
|
2023-03-27 17:26:53 +02:00
|
|
|
document.querySelector('#dropdown_batch').classList.remove('open');
|
2023-03-27 17:21:35 +02:00
|
|
|
hide(document.querySelector('.js_delete_motivation'));
|
2018-07-12 11:50:47 +02:00
|
|
|
}
|
2019-02-18 17:52:15 +01:00
|
|
|
|
2023-03-27 16:07:24 +02:00
|
|
|
export function showDeleteJustificatif(name) {
|
2023-03-27 17:26:53 +02:00
|
|
|
const justificatif = document.querySelector(
|
|
|
|
'#dossier_justificatif_motivation_' + name
|
|
|
|
);
|
2023-03-27 17:45:06 +02:00
|
|
|
|
2023-03-27 16:07:24 +02:00
|
|
|
if (justificatif.value != '') {
|
|
|
|
show(document.querySelector('#delete_motivation_import_' + name));
|
2023-03-27 17:45:06 +02:00
|
|
|
document.querySelector('#delete_motivation_import_' + name);
|
2023-03-27 16:07:24 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
export function deleteJustificatif(name) {
|
2023-03-27 17:26:53 +02:00
|
|
|
const justificatif = document.querySelector(
|
|
|
|
'#dossier_justificatif_motivation_' + name
|
|
|
|
);
|
|
|
|
justificatif.value = '';
|
2023-03-27 16:07:24 +02:00
|
|
|
hide(document.querySelector('#delete_motivation_import_' + name));
|
|
|
|
}
|
|
|
|
|
2019-02-18 17:52:15 +01:00
|
|
|
export function showImportJustificatif(name) {
|
|
|
|
show(document.querySelector('#justificatif_motivation_import_' + name));
|
|
|
|
hide(document.querySelector('#justificatif_motivation_suggest_' + name));
|
|
|
|
}
|