demarches-normaliennes/app/javascript/new_design/state-button.js
2019-05-07 08:54:29 +02:00

18 lines
592 B
JavaScript

import { show, hide } from '@utils';
export function showMotivation(event, state) {
event.preventDefault();
motivationCancel();
show(document.querySelector(`.motivation.${state}`));
hide(document.querySelector('.dropdown-items'));
}
export function motivationCancel() {
document.querySelectorAll('.motivation').forEach(hide);
show(document.querySelector('.dropdown-items'));
}
export function showImportJustificatif(name) {
show(document.querySelector('#justificatif_motivation_import_' + name));
hide(document.querySelector('#justificatif_motivation_suggest_' + name));
}