Skip to content

Commit

Permalink
Tweak styling and budget filter modal
Browse files Browse the repository at this point in the history
  • Loading branch information
BrunoBernardino committed Jul 20, 2022
1 parent 56148b1 commit 72bf1d1
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 16 deletions.
10 changes: 4 additions & 6 deletions public/css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,7 @@ a.button.secondary:focus {
display: block;
margin-bottom: 0.5rem;
font-weight: bold;
color: var(--color-link-hover-dark);
color: var(--color-link);
text-align: left;
}

Expand All @@ -383,10 +383,6 @@ a.button.secondary:focus {
display: inline-block;
}

#add-expense-form .input-wrapper>label {
color: var(--color-link);
}

.input-wrapper input[type="text"],
.input-wrapper input[type="date"],
.input-wrapper input[type="datetime"],
Expand Down Expand Up @@ -691,6 +687,8 @@ a.button.secondary:focus {
justify-content: space-between;
padding: 0.5rem;
transition: all 60ms ease-in-out;
color: var(--color-link-hover-dark);
border-radius: 3px;
}

#budgets-filter-form .input-wrapper > label:hover {
Expand Down Expand Up @@ -771,7 +769,7 @@ a.button.secondary:focus {
}

.text {
color: #ccc;
color: var(--color-link);
text-align: center;
align-items: center;
flex: 1;
Expand Down
15 changes: 5 additions & 10 deletions public/js/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,7 @@

async function navigateToMonth(month) {
currentMonth = month;
budgetFilters.clear();
await showData();
}

Expand Down Expand Up @@ -610,22 +611,16 @@
template: '#budgets-filter-modal',
focusConfirm: false,
allowEscapeKey: true,
showConfirmButton: false,
didClose: () => {
budgetsFilterButton.blur();
},
willOpen: async () => {
// Show all budgets in #budgets-filter-form
const allBudgets = await window.app.dataUtils.fetchBudgets();
const allUniquelyNamedBudgets = allBudgets.reduce((budgetsList, budget) => {
if (!budgetsList.some((_budget) => budget.name === _budget.name)) {
budgetsList.push(budget);
}

return budgetsList;
}, []);
// Show month's budgets in #budgets-filter-form
const monthBudgets = await window.app.dataUtils.fetchBudgets(currentMonth);
const budgetsFilterForm = document.getElementById('budgets-filter-form');
budgetsFilterForm.replaceChildren();
for (const budget of allUniquelyNamedBudgets) {
for (const budget of monthBudgets) {
const element = getBudgetsFilterModalBudgetItemHtmlElement(budget);

const inputElement = element.querySelector('input');
Expand Down

0 comments on commit 72bf1d1

Please sign in to comment.