Skip to content

Commit

Permalink
Merge pull request #971 from nextcloud/fix/print
Browse files Browse the repository at this point in the history
Printing fixes
  • Loading branch information
mejo- authored Oct 30, 2023
2 parents ce6bf90 + e7b40fd commit 9681cdc
Show file tree
Hide file tree
Showing 8 changed files with 49 additions and 7 deletions.
21 changes: 21 additions & 0 deletions src/Collectives.vue
Original file line number Diff line number Diff line change
Expand Up @@ -162,13 +162,34 @@ export default {
}
@media print {
html, body {
background: var(--color-main-background, white) !important;
}
/* hide toast notifications for printing */
.toastify.dialogs {
display: none;
}
#header {
display: none !important;
}
#content-vue {
display: block !important;
}
#text-wrapper #text .content-wrapper {
display: block;
div.ProseMirror {
margin-top: 0;
margin-bottom: 0;
padding-top: 0;
padding-bottom: 0;
}
}
}
/* Align toggle with page list header bar */
Expand Down
1 change: 1 addition & 0 deletions src/components/Collective/CollectiveActions.vue
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ export default {
'isCollectiveAdmin',
'isPublic',
'loading',
'shareTokenParam',
]),
circleLink() {
Expand Down
4 changes: 2 additions & 2 deletions src/components/CollectivePrint.vue
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,8 @@ export default {
},
waitForImages() {
const images = document.querySelectorAll('#text-container div.image')
const loading = document.querySelectorAll('#text-container div.image.icon-loading')
const images = document.querySelectorAll('#text-container figure.image')
const loading = document.querySelectorAll('#text-container figure.image.icon-loading')
this.loadImages.total = images.length
this.loadImages.count = images.length - loading.length
Expand Down
7 changes: 7 additions & 0 deletions src/components/Page/LandingPageWidgets.vue
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,11 @@ export default {
.landing-page-widgets {
padding-left: 12px;
}
@media print {
/* Don't print unwanted elements */
.landing-page-widgets {
display: none !important;
}
}
</style>
2 changes: 1 addition & 1 deletion src/components/Page/RichText.vue
Original file line number Diff line number Diff line change
Expand Up @@ -252,9 +252,9 @@ export default {

<style lang="scss">
@media print {
h1, h2, h3 {
page-break-after: avoid;
break-after: avoid;
}
}
</style>
7 changes: 7 additions & 0 deletions src/components/Page/TextEditor.vue
Original file line number Diff line number Diff line change
Expand Up @@ -279,4 +279,11 @@ export default {
}
}
}
@media print {
/* Don't print unwanted elements */
.text-container-heading {
display: none !important;
}
}
</style>
7 changes: 4 additions & 3 deletions src/components/PageList/Item.vue
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,9 @@
{{ pageTitleString }}
</div>
</router-link>
<div v-if="canEdit" class="page-list-item-actions">
<PageActionMenu :page-id="pageId"
<div class="page-list-item-actions">
<PageActionMenu v-if="canEdit || isLandingPage"
:page-id="pageId"
:page-url="to"
:parent-id="parentId"
:timestamp="timestamp"
Expand All @@ -67,7 +68,7 @@
:is-landing-page="isLandingPage"
:is-template="isTemplate"
:in-page-list="true" />
<NcActions>
<NcActions v-if="canEdit">
<NcActionButton class="action-button-add" @click="newPage(pageId)">
<template #icon>
<PlusIcon :size="20" fill-color="var(--color-main-text)" />
Expand Down
7 changes: 6 additions & 1 deletion src/components/PagePrint.vue
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ export default {
&-subpage {
page-break-before: always;
break-before: always;
}
}
Expand All @@ -114,10 +115,14 @@ export default {
}
.editor__content {
display: block;
position: relative;
}
:deep(#read-only-editor div.ProseMirror) {
margin-top: revert;
margin-top: 0;
margin-bottom: 0;
padding-top: 0;
padding-bottom: 0;
}
</style>

0 comments on commit 9681cdc

Please sign in to comment.