diff options
author | John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com> | 2018-10-05 10:13:16 +0200 |
---|---|---|
committer | John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com> | 2018-10-05 10:13:16 +0200 |
commit | a6a3fa0d0617afa45ffd5b428c3b94c5cb55ea90 (patch) | |
tree | e9b5e7352a1f8562ef19c6fa68f6652ee0bf4a07 /src/views | |
parent | 5279b43599ba418b997803b03ef2d788b30d663b (diff) |
Add search
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
Diffstat (limited to 'src/views')
-rw-r--r-- | src/views/Contacts.vue | 21 |
1 files changed, 19 insertions, 2 deletions
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 @@ <import-screen v-if="importState.stage !== 'default'" /> <template v-else> <!-- contacts list --> - <content-list :list="contactsList" :contacts="contacts" :loading="loading" /> + <content-list :list="contactsList" :contacts="contacts" :loading="loading" + :search-query="searchQuery" /> <!-- main contacts details --> <contact-details :loading="loading" :uid="selectedContact" /> </template> @@ -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('') } } } |