Browse Source

Reset global search on files sidebar navigation change

Signed-off-by: Christopher Ng <chrng8@gmail.com>
tags/v25.0.0beta7
Christopher Ng 1 year ago
parent
commit
a7c7d84f59

+ 2
- 0
apps/files/js/app.js View File

@@ -323,6 +323,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')
}
},

@@ -374,6 +375,7 @@
this.navigation.getActiveContainer().trigger(new $.Event('show'));
}
this.navigation.getActiveContainer().trigger(new $.Event('urlChanged', params));
window._nc_event_bus.emit('files:navigation:changed')
},

/**

+ 10
- 1
core/src/views/UnifiedSearch.vue View File

@@ -150,7 +150,7 @@
</template>

<script>
import { emit } from '@nextcloud/event-bus'
import { emit, subscribe, unsubscribe } from '@nextcloud/event-bus'
import { minSearchLength, getTypes, search, defaultLimit, regexFilterIn, regexFilterNot, enableLiveSearch } from '../services/UnifiedSearchService'
import { showError } from '@nextcloud/dialogs'

@@ -329,10 +329,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() {
if (OCP.Accessibility.disableKeyboardShortcuts()) {
return
@@ -371,6 +376,10 @@ export default {
emit('nextcloud:unified-search.close')
},

resetForm() {
this.$el.querySelector('form[role="search"]').reset()
},

/**
* Reset the search state
*/

+ 2
- 2
dist/core-unified-search.js
File diff suppressed because it is too large
View File


+ 1
- 1
dist/core-unified-search.js.map
File diff suppressed because it is too large
View File


Loading…
Cancel
Save