From b580ff05d1b7d2c91c9492e257717083486c4cf2 Mon Sep 17 00:00:00 2001 From: Jessica Date: Mon, 17 Sep 2018 15:54:36 +0200 Subject: added condition to watch if popover menu was closed and change editingName to false --- src/components/Settings/SettingsAddressbook.vue | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'src/components/Settings/SettingsAddressbook.vue') diff --git a/src/components/Settings/SettingsAddressbook.vue b/src/components/Settings/SettingsAddressbook.vue index a4174c57..97d29303 100644 --- a/src/components/Settings/SettingsAddressbook.vue +++ b/src/components/Settings/SettingsAddressbook.vue @@ -142,6 +142,13 @@ export default { return menu } }, + watch: { + menuOpen: function() { + if (this.menuOpen === false) { + this.editingName = false + } + } + }, mounted() { // required if popup needs to stay opened after menu click this.popupItem = this.$el @@ -203,10 +210,11 @@ export default { this.renameLoading = true setTimeout(() => { try { - this.$store.dispatch('renameAddressbook', { addressbook, newName }).then(this.editingName = false) // .then(e.target.parent.classList.add()) + this.$store.dispatch('renameAddressbook', { addressbook, newName }) // .then(e.target.parent.classList.add()) } catch (err) { // error handling } finally { + this.editingName = false // stop loading status regardless of outcome this.renameLoading = false } -- cgit v1.2.3