From 0281e9dafc6a85b176da3786b62c607e1573e80e Mon Sep 17 00:00:00 2001
From: "John Molakvoæ (skjnldsv)" <skjnldsv@protonmail.com>
Date: Tue, 19 Jun 2018 11:16:36 +0200
Subject: Fit user search to new standard
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
---
 settings/src/components/userList.vue | 14 +++++---------
 1 file changed, 5 insertions(+), 9 deletions(-)

(limited to 'settings/src/components/userList.vue')

diff --git a/settings/src/components/userList.vue b/settings/src/components/userList.vue
index 31a3bfcd4ef..9b599fb275d 100644
--- a/settings/src/components/userList.vue
+++ b/settings/src/components/userList.vue
@@ -189,11 +189,9 @@ export default {
 		this.setNewUserDefaultGroup(this.$route.params.selectedGroup);
 
 		/** 
-		 * Enable search
+		 * Register search
 		 */
-		document.getElementById('searchbox').style.display = 'block';
-		document.getElementById('searchbox').addEventListener('input', this.search);
-		document.querySelector('.searchbox .icon-close-white').addEventListener('click', this.resetSearch);
+		this.userSearch = new OCA.Search(this.search, this.resetSearch);
 	},
 	computed: {
 		settings() {
@@ -309,15 +307,13 @@ export default {
 		},
 
 		/* SEARCH */
-		search() {
-			this.searchQuery = document.getElementById('searchbox').value;
+		search(query) {
+			this.searchQuery = query;
 			this.$store.commit('resetUsers');
 			this.$refs.infiniteLoading.$emit('$InfiniteLoading:reset');
 		},
 		resetSearch() {
-			this.searchQuery = '';
-			document.getElementById('searchbox').value = '';
-			this.search();
+			this.search('');
 		},
 
 		resetForm() {
-- 
cgit v1.2.3

