summaryrefslogtreecommitdiffstats
path: root/core/src/views
diff options
context:
space:
mode:
authorJohn Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>2020-09-11 12:18:10 +0200
committerJohn Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>2020-09-14 16:05:37 +0200
commit58b19efd7492bd2edc112da9c3acdd0456385061 (patch)
tree90b0dda6ee30144ae3a31a89ac9006c41dcf9a76 /core/src/views
parentc1ff011990294bf5eb431a82550be64a3775574f (diff)
downloadnextcloud-server-58b19efd7492bd2edc112da9c3acdd0456385061.tar.gz
nextcloud-server-58b19efd7492bd2edc112da9c3acdd0456385061.zip
Add users and apps inner search and add HeaderMenu cancel
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
Diffstat (limited to 'core/src/views')
-rw-r--r--core/src/views/UnifiedSearch.vue25
1 files changed, 22 insertions, 3 deletions
diff --git a/core/src/views/UnifiedSearch.vue b/core/src/views/UnifiedSearch.vue
index 3406cd9db09..c721689537b 100644
--- a/core/src/views/UnifiedSearch.vue
+++ b/core/src/views/UnifiedSearch.vue
@@ -39,7 +39,8 @@
type="search"
:placeholder="t('core', 'Search {types} …', { types: typesNames.join(', ').toLowerCase() })"
@input="onInputDebounced"
- @keypress.enter.prevent.stop="onInputEnter">
+ @keypress.enter.prevent.stop="onInputEnter"
+ @search="onSearch">
<!-- Search filters -->
<Actions v-if="availableFilters.length > 1" class="unified-search__filters" placement="bottom">
<ActionButton v-for="type in availableFilters"
@@ -288,11 +289,17 @@ export default {
this.types = await getTypes()
},
onClose() {
- this.resetState()
- this.query = ''
emit('nextcloud:unified-search:close')
},
+ /**
+ * Reset the search state
+ */
+ resetSearch() {
+ emit('nextcloud:unified-search:reset')
+ this.query = ''
+ this.resetState()
+ },
resetState() {
this.cursors = {}
this.limits = {}
@@ -313,6 +320,18 @@ export default {
},
/**
+ * Watch the search event on the input
+ * Used to detect the reset button press
+ * @param {Event} event the search event
+ */
+ onSearch(event) {
+ // If value is empty, the reset button has been pressed
+ if (event.target.value === '') {
+ this.resetSearch()
+ }
+ },
+
+ /**
* If we have results already, open first one
* If not, trigger the search again
*/