Skip to content

Commit

Permalink
Emit unified search query
Browse files Browse the repository at this point in the history
Signed-off-by: Raimund Schlüßler <raimund.schluessler@mailbox.org>
  • Loading branch information
raimund-schluessler committed Sep 1, 2020
1 parent 6bda2c2 commit efe6f75
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion core/js/dist/unified-search.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion core/js/dist/unified-search.js.map

Large diffs are not rendered by default.

6 changes: 6 additions & 0 deletions core/src/views/UnifiedSearch.vue
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ import { minSearchLength, getTypes, search, defaultLimit } from '../services/Uni
import EmptyContent from '@nextcloud/vue/dist/Components/EmptyContent'
import Magnify from 'vue-material-design-icons/Magnify'
import debounce from 'debounce'
import { emit } from '@nextcloud/event-bus'
import HeaderMenu from '../components/HeaderMenu'
import SearchResult from '../components/UnifiedSearch/SearchResult'
Expand Down Expand Up @@ -243,6 +244,8 @@ export default {
onClose() {
this.resetState()
this.query = ''
// emit the search query
emit('nextcloud:unified-search:close')
},
resetState() {
Expand Down Expand Up @@ -281,6 +284,9 @@ export default {
* Start searching on input
*/
async onInput() {
// emit the search query
emit('nextcloud:unified-search:search', { query: this.query })
// Do not search if not long enough
if (this.query.trim() === '' || this.isShortQuery) {
return
Expand Down

0 comments on commit efe6f75

Please sign in to comment.