Refactor state button helpers

This commit is contained in:
Paul Chavard 2018-10-09 11:43:51 +02:00
parent 3897d4abf4
commit 9d5ffba068
3 changed files with 6 additions and 7 deletions

View file

@ -2,7 +2,6 @@
@import "constants";
.motivation {
display: none;
padding: $default-padding;
color: $black;
width: 450px;

View file

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

View file

@ -1,4 +1,4 @@
.motivation{ class: popup_class }
.motivation.hidden{ class: popup_class }
%h3
%span.icon{ class: popup_class }
#{popup_title}