mirror of
https://github.com/nextcloud/server.git
synced 2026-03-02 21:41:12 -05:00
Merge pull request #34106 from nextcloud/backport/34100/stable24
[stable24] Reset global search on files sidebar navigation change
This commit is contained in:
commit
cb0bfae73e
4 changed files with 15 additions and 4 deletions
|
|
@ -309,6 +309,7 @@
|
|||
this._changeUrl(params.view, params.dir);
|
||||
OC.Apps.hideAppSidebar($('.detailsView'));
|
||||
this.navigation.getActiveContainer().trigger(new $.Event('urlChanged', params));
|
||||
window._nc_event_bus.emit('files:navigation:changed')
|
||||
}
|
||||
},
|
||||
|
||||
|
|
@ -360,6 +361,7 @@
|
|||
this.navigation.getActiveContainer().trigger(new $.Event('show'));
|
||||
}
|
||||
this.navigation.getActiveContainer().trigger(new $.Event('urlChanged', params));
|
||||
window._nc_event_bus.emit('files:navigation:changed')
|
||||
},
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -123,7 +123,7 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
import { emit } from '@nextcloud/event-bus'
|
||||
import { emit, subscribe, unsubscribe } from '@nextcloud/event-bus'
|
||||
import { minSearchLength, getTypes, search, defaultLimit, regexFilterIn, regexFilterNot } from '../services/UnifiedSearchService'
|
||||
import { showError } from '@nextcloud/dialogs'
|
||||
|
||||
|
|
@ -300,10 +300,15 @@ export default {
|
|||
},
|
||||
|
||||
async created() {
|
||||
subscribe('files:navigation:changed', this.resetForm)
|
||||
this.types = await getTypes()
|
||||
this.logger.debug('Unified Search initialized with the following providers', this.types)
|
||||
},
|
||||
|
||||
beforeDestroy() {
|
||||
unsubscribe('files:navigation:changed', this.resetForm)
|
||||
},
|
||||
|
||||
mounted() {
|
||||
document.addEventListener('keydown', (event) => {
|
||||
// if not already opened, allows us to trigger default browser on second keydown
|
||||
|
|
@ -338,6 +343,10 @@ export default {
|
|||
emit('nextcloud:unified-search.close')
|
||||
},
|
||||
|
||||
resetForm() {
|
||||
this.$el.querySelector('form[role="search"]').reset()
|
||||
},
|
||||
|
||||
/**
|
||||
* Reset the search state
|
||||
*/
|
||||
|
|
|
|||
4
dist/core-unified-search.js
vendored
4
dist/core-unified-search.js
vendored
File diff suppressed because one or more lines are too long
2
dist/core-unified-search.js.map
vendored
2
dist/core-unified-search.js.map
vendored
File diff suppressed because one or more lines are too long
Loading…
Reference in a new issue