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

19 lines
592 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();
2018-10-09 11:43:51 +02:00
show(document.querySelector(`.motivation.${state}`));
hide(document.querySelector('.dropdown-items'));
}
export function motivationCancel() {
2018-10-09 11:43:51 +02:00
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));
}