diff --git a/src/lib/ui.desktop.js b/src/lib/ui.desktop.js index 306a707f..6c30dcbd 100644 --- a/src/lib/ui.desktop.js +++ b/src/lib/ui.desktop.js @@ -10,6 +10,32 @@ export function getOuterHeight(element) { .reduce((prev, cur) => prev + cur); } +export function getNavSideBarOuterHeight(element) { + if (!element) { + return 0; + } + + const contentEl = element.querySelectorAll('.v-navigation-drawer__content'); + + if (!contentEl || !contentEl[0]) { + return 0; + } + + const children = contentEl[0].children; + + if (!children || children.length < 1) { + return 0; + } + + let totalHeight = 0; + + for (let i = 0; i < children.length; i++) { + totalHeight += getOuterHeight(children[i]); + } + + return totalHeight; +} + export function getCssValue(element, name) { if (!element) { return 0; diff --git a/src/views/desktop/categories/ListPage.vue b/src/views/desktop/categories/ListPage.vue index b5e46012..42bad157 100644 --- a/src/views/desktop/categories/ListPage.vue +++ b/src/views/desktop/categories/ListPage.vue @@ -9,12 +9,12 @@ { name: $t('Expense'), value: allCategoryTypes.Expense }, { name: $t('Income'), value: allCategoryTypes.Income }, { name: $t('Transfer'), value: allCategoryTypes.Transfer } - ]" v-model="activeCategoryType" @update:modelValue="switchActiveCategoryType" /> + ]" v-model="activeCategoryType" @update:modelValue="switchAllPrimaryCategories" /> - + {{ $t('Primary Categories') }}