Merge pull request #48861 from nextcloud/backport/48850/stable30

This commit is contained in:
Kate 2024-10-28 16:26:45 +01:00 committed by GitHub
commit 5c460f23ae
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 10 additions and 7 deletions

View file

@ -97,7 +97,9 @@ export default defineComponent({
mounted() {
// register keyboard listener for search shortcut
window.addEventListener('keydown', this.onKeyDown)
if (window.OCP.Accessibility.disableKeyboardShortcuts() === false) {
window.addEventListener('keydown', this.onKeyDown)
}
// Allow external reset of the search / close local search
subscribe('nextcloud:unified-search:reset', () => {
@ -131,9 +133,9 @@ export default defineComponent({
if (event.ctrlKey && event.code === 'KeyF') {
// only handle search if not already open - in this case the browser native search should be used
if (!this.showLocalSearch && !this.showUnifiedSearch) {
this.toggleUnifiedSearch()
event.preventDefault()
}
this.toggleUnifiedSearch()
}
},
@ -142,9 +144,10 @@ export default defineComponent({
*/
toggleUnifiedSearch() {
if (this.supportsLocalSearch) {
this.showLocalSearch = true
this.showLocalSearch = !this.showLocalSearch
} else {
this.openModal()
this.showUnifiedSearch = !this.showUnifiedSearch
this.showLocalSearch = false
}
},

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long