diff options
author | Jessica <jessica@Absolventas-MacBook-Pro.local> | 2018-09-17 15:54:36 +0200 |
---|---|---|
committer | Jessica <jessica@Absolventas-MacBook-Pro.local> | 2018-09-17 15:54:36 +0200 |
commit | b580ff05d1b7d2c91c9492e257717083486c4cf2 (patch) | |
tree | 5b45bdc8d4983d2b796fca89fbab1bd8cc1dc5c8 /src/components/Settings/SettingsAddressbook.vue | |
parent | aeaec3910078e675555d507fdd3846bcfe5e21be (diff) |
added condition to watch if popover menu was closed and change editingName to false
Diffstat (limited to 'src/components/Settings/SettingsAddressbook.vue')
-rw-r--r-- | src/components/Settings/SettingsAddressbook.vue | 10 |
1 files changed, 9 insertions, 1 deletions
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 } |