Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion src/components/card/AttachmentList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,9 @@ export default {
return (attachment) => attachment?.extendedData?.info?.extension
?? (attachment?.name ?? attachment.data).split('.').pop()
},
cardDetailsInModal() {
return this.$store.getters.config('cardDetailsInModal')
},
},
watch: {
cardId: {
Expand Down Expand Up @@ -245,7 +248,17 @@ export default {
},
showViewer(attachment) {
if (attachment.extendedData.fileid && window.OCA.Viewer.availableHandlers.map(handler => handler.mimes).flat().includes(attachment.extendedData.mimetype)) {
window.OCA.Viewer.open({ path: attachment.extendedData.path })
// Hide the sidebar if opening card in modal to avoid wrong sidebar position calculating in Viewer app
const sidebar = document.querySelector('aside.app-sidebar')
if (sidebar && this.cardDetailsInModal) {
sidebar.style.display = 'none'
}
const onClose = () => {
if (sidebar && sidebar.style.display === 'none') {
sidebar.style.display = ''
}
}
window.OCA.Viewer.open({ path: attachment.extendedData.path, onClose })
return
}

Expand Down
Loading