From a6a3fa0d0617afa45ffd5b428c3b94c5cb55ea90 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?John=20Molakvo=C3=A6=20=28skjnldsv=29?= Date: Fri, 5 Oct 2018 10:13:16 +0200 Subject: Add search MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: John Molakvoæ (skjnldsv) --- src/views/Contacts.vue | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) (limited to 'src/views') diff --git a/src/views/Contacts.vue b/src/views/Contacts.vue index fe947279..8e4c638a 100644 --- a/src/views/Contacts.vue +++ b/src/views/Contacts.vue @@ -36,7 +36,8 @@ @@ -83,7 +84,8 @@ export default { data() { return { - loading: true + loading: true, + searchQuery: '' } }, @@ -200,6 +202,13 @@ export default { } }, + mounted() { + /** + * Register search + */ + this.userSearch = new OCA.Search(this.search, this.resetSearch) + }, + beforeMount() { // get addressbooks then get contacts client.connect({ enableCardDAV: true }).then(() => { @@ -302,6 +311,14 @@ export default { }) } } + }, + + /* SEARCH */ + search(query) { + this.searchQuery = query + }, + resetSearch() { + this.search('') } } } -- cgit v1.2.3