diff options
author | Jessica <jessica@Absolventas-MacBook-Pro.local> | 2018-09-06 15:57:35 +0200 |
---|---|---|
committer | Jessica <jessica@Absolventas-MacBook-Pro.local> | 2018-09-06 15:57:35 +0200 |
commit | f3c0746e5bc2e4e04e4b25bce8169a25541eef26 (patch) | |
tree | f701f0f0c8a6cb5fe182944488d19ebdeb463794 /src/components/Settings/SettingsAddressbook.vue | |
parent | 39de5be0237c3c661b7e566ca226b003fb667612 (diff) |
added key & changed check for addressbooks length to if
Diffstat (limited to 'src/components/Settings/SettingsAddressbook.vue')
-rw-r--r-- | src/components/Settings/SettingsAddressbook.vue | 66 |
1 files changed, 35 insertions, 31 deletions
diff --git a/src/components/Settings/SettingsAddressbook.vue b/src/components/Settings/SettingsAddressbook.vue index 604c6818..244cf2ab 100644 --- a/src/components/Settings/SettingsAddressbook.vue +++ b/src/components/Settings/SettingsAddressbook.vue @@ -91,41 +91,45 @@ export default { }, // building the popover menu menu() { - return [{ - href: '#', - icon: 'icon-public', - text: !this.copied - ? t('contacts', 'Copy link') - : this.copySuccess - ? t('contacts', 'Copied') - : t('contacts', 'Can not copy'), - action: this.copyLink - }, - { - href: this.addressbook.url + '?export', - icon: 'icon-download', - text: t('contacts', 'Download'), - action: '' - }, - { - icon: 'icon-rename', - text: t('contacts', 'Rename'), - action: this.renameAddressbook - }, - { - icon: 'checkbox', - text: this.enabled ? t('contacts', 'Enabled') : t('contacts', 'Disabled'), - input: 'checkbox', - model: this.enabled, - action: this.toggleAddressbookEnabled - }, + let menu = + [{ + href: this.addressbook.url, + icon: 'icon-public', + text: !this.copied + ? t('contacts', 'Copy link') + : this.copySuccess + ? t('contacts', 'Copied') + : t('contacts', 'Can not copy'), + action: this.copyLink + }, + { + href: this.addressbook.url + '?export', + icon: 'icon-download', + text: t('contacts', 'Download'), + action: null + }, + { + icon: 'icon-rename', + text: t('contacts', 'Rename'), + action: this.renameAddressbook + }, + { + icon: 'checkbox', + text: this.enabled ? t('contacts', 'Enabled') : t('contacts', 'Disabled'), + input: 'checkbox', + key: 'enableAddressbook', + model: this.enabled, + action: this.toggleAddressbookEnabled + }] // check to ensure last addressbook is not deleted. - this.$store.getters.getAddressbooks.length > 1 - ? { + if (this.$store.getters.getAddressbooks.length > 1 ) { + menu.push({ icon: 'icon-delete', text: t('contacts', 'Delete'), action: this.deleteAddressbook - } : {}] + }) + } + return menu } }, mounted() { |