demarches-normaliennes/app/javascript/new_design/instruction-button.js

26 lines
761 B
JavaScript
Raw Normal View History

2018-10-09 11:43:51 +02:00
import { show, hide } from '@utils';
2018-08-09 11:53:59 +02:00
export function showMotivation(event, state) {
event.preventDefault();
motivationCancel();
2023-02-28 10:49:50 +01:00
const stateElement = document.querySelector(`.motivation.${state}`);
show(stateElement.parentElement);
show(stateElement);
2018-10-09 11:43:51 +02:00
hide(document.querySelector('.dropdown-items'));
}
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));
2018-10-09 11:43:51 +02:00
show(document.querySelector('.dropdown-items'));
}
export function showImportJustificatif(name) {
show(document.querySelector('#justificatif_motivation_import_' + name));
hide(document.querySelector('#justificatif_motivation_suggest_' + name));
}