Skip to content

Open source personal finance application

feat (CategoryModal): open parent modal when delete child category

ilkome23ab6dd45707
diff --git a/components/categories/EditModal.vue b/components/categories/EditModal.vue
index 3f540fce..1e64b9ee 100644
--- a/components/categories/EditModal.vue
+++ b/components/categories/EditModal.vue
@@ -354,8 +354,6 @@ Portal(
@import '~assets/stylus/variables'
.header
- max-width 400px
- margin 0 auto
padding $m8
flex-grow 1
fontFamilyNunito()
@@ -379,11 +377,17 @@ Portal(
min-height 50px
padding 8px
font-size 30px
+ border-radius 4px
+
+ +media-hover()
+ &:not(._active)
+ cursor pointer
+ background var(--c-item-bg-hover)
+ border 1px solid var(--c-item-bd-hover)
&._active
- background var(--c-bg-2)
- border-radius 4px
- box-shadow 0 2px 10px 0 var(--shaddow)
+ background var(--c-item-bg-hover)
+ border 1px solid var(--c-item-bd-hover)
.customColor
margin (- $m7)
@@ -411,8 +415,6 @@ Portal(
padding-bottom $m8
.content
- max-width 400px
- margin 0 auto
padding $m8
background var(--c-bg-3)
+media(600px)
diff --git a/components/categories/Modal.vue b/components/categories/Modal.vue
index e069aa94..8b805f2f 100644
--- a/components/categories/Modal.vue
+++ b/components/categories/Modal.vue
@@ -98,8 +98,13 @@ export default {
const id = this.categoryId
this.showModalConfirm = false
- this.$store.commit('categories/hideCategoryModal')
- this.$store.commit('categories/setCategoryModalId', null)
+ if (this.category.parentId !== 0) {
+ this.$store.commit('categories/setCategoryModalId', this.category.parentId)
+ }
+ else {
+ this.$store.commit('categories/hideCategoryModal')
+ this.$store.commit('categories/setCategoryModalId', null)
+ }
setTimeout(async () => {
await this.$store.dispatch('trns/deleteTrnsByIds', trnsIds)