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

14 lines
391 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'));
}