Skip to content

Commit

Permalink
Revert "[issue-nextcloud#39] It is now possible to download group of …
Browse files Browse the repository at this point in the history
…contacts."

This reverts commit 78c8afe.
  • Loading branch information
charismatic-claire committed Nov 9, 2018
1 parent 092f825 commit 2aa8877
Showing 1 changed file with 1 addition and 29 deletions.
30 changes: 1 addition & 29 deletions src/views/Contacts.vue
Original file line number Diff line number Diff line change
Expand Up @@ -145,14 +145,7 @@ export default {
},
text: group.name,
utils: {
counter: group.contacts.length,
actions: [
{
icon: 'icon-download',
text: 'Download',
action: this.downloadGroup(group)
}
]
counter: group.contacts.length
}
}
}).sort(function(a, b) {
Expand Down Expand Up @@ -326,27 +319,6 @@ export default {
},
resetSearch() {
this.search('')
},

/* DOWNLOAD */
downloadGroup(group) {
// create result
const contacts = this.contacts
const result = group.contacts.map(uid => contacts[uid].dav.data).join('')
// return result
return function() {
// create element
let element = document.createElement('a')
element.setAttribute('href', 'data:text/plain;charset=utf-8,' + encodeURIComponent(result))
element.setAttribute('download', group.name + '.vcf')
element.style.display = 'none'
// add element to dom
document.body.appendChild(element)
// click on element
element.click()
// remove element from dom
document.body.removeChild(element)
}
}
}
}
Expand Down

0 comments on commit 2aa8877

Please sign in to comment.