Merge pull request #22526 from nextcloud/feature/unified-search/emit-query

Emit unified search query
This commit is contained in:
John Molakvoæ 2020-09-02 09:27:58 +02:00 committed by GitHub
commit 34aca46325
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
13 changed files with 17 additions and 12 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -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'
@ -243,6 +244,7 @@ export default {
onClose() {
this.resetState()
this.query = ''
emit('nextcloud:unified-search:close')
},
resetState() {
@ -281,6 +283,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