Merge pull request #22526 from nextcloud/feature/unified-search/emit-query
Emit unified search query
This commit is contained in:
commit
34aca46325
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
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue