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 EmptyContent from '@nextcloud/vue/dist/Components/EmptyContent'
|
||||||
import Magnify from 'vue-material-design-icons/Magnify'
|
import Magnify from 'vue-material-design-icons/Magnify'
|
||||||
import debounce from 'debounce'
|
import debounce from 'debounce'
|
||||||
|
import { emit } from '@nextcloud/event-bus'
|
||||||
|
|
||||||
import HeaderMenu from '../components/HeaderMenu'
|
import HeaderMenu from '../components/HeaderMenu'
|
||||||
import SearchResult from '../components/UnifiedSearch/SearchResult'
|
import SearchResult from '../components/UnifiedSearch/SearchResult'
|
||||||
|
@ -243,6 +244,7 @@ export default {
|
||||||
onClose() {
|
onClose() {
|
||||||
this.resetState()
|
this.resetState()
|
||||||
this.query = ''
|
this.query = ''
|
||||||
|
emit('nextcloud:unified-search:close')
|
||||||
},
|
},
|
||||||
|
|
||||||
resetState() {
|
resetState() {
|
||||||
|
@ -281,6 +283,9 @@ export default {
|
||||||
* Start searching on input
|
* Start searching on input
|
||||||
*/
|
*/
|
||||||
async onInput() {
|
async onInput() {
|
||||||
|
// emit the search query
|
||||||
|
emit('nextcloud:unified-search:search', { query: this.query })
|
||||||
|
|
||||||
// Do not search if not long enough
|
// Do not search if not long enough
|
||||||
if (this.query.trim() === '' || this.isShortQuery) {
|
if (this.query.trim() === '' || this.isShortQuery) {
|
||||||
return
|
return
|
||||||
|
|
Loading…
Reference in New Issue