From 106a72dd787419edbae4bf64171cb13f2e45078e Mon Sep 17 00:00:00 2001 From: ogerly Date: Wed, 9 Nov 2022 14:36:11 +0100 Subject: [PATCH] better behaviour when editing --- .../ContributionLink/ContributionLink.vue | 18 ++++++++++++++++-- .../ContributionLink/ContributionLinkForm.vue | 5 +++++ admin/src/locales/de.json | 1 + admin/src/locales/en.json | 1 + 4 files changed, 23 insertions(+), 2 deletions(-) diff --git a/admin/src/components/ContributionLink/ContributionLink.vue b/admin/src/components/ContributionLink/ContributionLink.vue index a2d171d56..7190742f7 100644 --- a/admin/src/components/ContributionLink/ContributionLink.vue +++ b/admin/src/components/ContributionLink/ContributionLink.vue @@ -8,7 +8,11 @@ header-class="text-center" class="mt-5" > - + {{ $t('math.plus') }} {{ $t('contributionLink.newContributionLink') }} @@ -19,6 +23,7 @@ :contributionLinkData="contributionLinkData" :editContributionLink="editContributionLink" @get-contribution-links="$emit('get-contribution-links')" + @closeContributionForm="closeContributionForm" /> @@ -63,9 +68,18 @@ export default { } }, methods: { + closeContributionForm() { + if (this.visible) { + this.$root.$emit('bv::toggle::collapse', 'newContribution') + this.editContributionLink = false + } + }, editContributionLinkData(data) { - if (!this.visible) this.$root.$emit('bv::toggle::collapse', 'newContribution') + if (!this.visible) { + this.$root.$emit('bv::toggle::collapse', 'newContribution') + } this.contributionLinkData = data + console.log('contributionLinkData', this.contributionLinkData) this.editContributionLink = true }, }, diff --git a/admin/src/components/ContributionLink/ContributionLinkForm.vue b/admin/src/components/ContributionLink/ContributionLinkForm.vue index 05f5dac8b..ff7af8f7d 100644 --- a/admin/src/components/ContributionLink/ContributionLinkForm.vue +++ b/admin/src/components/ContributionLink/ContributionLinkForm.vue @@ -6,6 +6,7 @@ {{ $t('contributionLink.clear') }} + + {{ $t('contributionLink.close') }} + diff --git a/admin/src/locales/de.json b/admin/src/locales/de.json index ffe1cab24..c012e3171 100644 --- a/admin/src/locales/de.json +++ b/admin/src/locales/de.json @@ -5,6 +5,7 @@ "amount": "Betrag", "changeSaved": "Änderungen gespeichert", "clear": "Löschen", + "close": "Schließen", "contributionLinks": "Beitragslinks", "create": "Anlegen", "cycle": "Zyklus", diff --git a/admin/src/locales/en.json b/admin/src/locales/en.json index b32efe97e..9bff733c5 100644 --- a/admin/src/locales/en.json +++ b/admin/src/locales/en.json @@ -5,6 +5,7 @@ "amount": "Amount", "changeSaved": "Changes saved", "clear": "Clear", + "close": "Close", "contributionLinks": "Contribution Links", "create": "Create", "cycle": "Cycle",