mirror of
https://github.com/nextcloud/server.git
synced 2026-05-28 04:32:30 -04:00
Merge pull request #52674 from nextcloud/backport/52438/stable31
[stable31] fix(files): middle click & ctrl new tab
This commit is contained in:
commit
7f2a7fedb2
3 changed files with 7 additions and 5 deletions
|
|
@ -318,7 +318,7 @@ export default defineComponent({
|
|||
|
||||
// if ctrl+click / cmd+click (MacOS uses the meta key) or middle mouse button (button & 4), open in new tab
|
||||
// also if there is no default action use this as a fallback
|
||||
const metaKeyPressed = event.ctrlKey || event.metaKey || Boolean(event.button & 4)
|
||||
const metaKeyPressed = event.ctrlKey || event.metaKey || event.button === 1
|
||||
if (metaKeyPressed || !this.defaultFileAction) {
|
||||
// If no download permission, then we can not allow to download (direct link) the files
|
||||
if (isPublicShare() && !isDownloadable(this.source)) {
|
||||
|
|
@ -330,7 +330,9 @@ export default defineComponent({
|
|||
: generateUrl('/f/{fileId}', { fileId: this.fileid })
|
||||
event.preventDefault()
|
||||
event.stopPropagation()
|
||||
window.open(url, metaKeyPressed ? '_self' : undefined)
|
||||
|
||||
// Open the file in a new tab if the meta key or the middle mouse button is clicked
|
||||
window.open(url, metaKeyPressed ? '_blank' : '_self')
|
||||
return
|
||||
}
|
||||
|
||||
|
|
|
|||
4
dist/files-main.js
vendored
4
dist/files-main.js
vendored
File diff suppressed because one or more lines are too long
2
dist/files-main.js.map
vendored
2
dist/files-main.js.map
vendored
File diff suppressed because one or more lines are too long
Loading…
Reference in a new issue