Refactor state button helpers
This commit is contained in:
parent
3897d4abf4
commit
9d5ffba068
3 changed files with 6 additions and 7 deletions
|
@ -2,7 +2,6 @@
|
|||
@import "constants";
|
||||
|
||||
.motivation {
|
||||
display: none;
|
||||
padding: $default-padding;
|
||||
color: $black;
|
||||
width: 450px;
|
||||
|
|
|
@ -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'));
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
.motivation{ class: popup_class }
|
||||
.motivation.hidden{ class: popup_class }
|
||||
%h3
|
||||
%span.icon{ class: popup_class }
|
||||
#{popup_title}
|
||||
|
|
Loading…
Reference in a new issue