From a31feeab789d81ef8241744965f2837aaade601c Mon Sep 17 00:00:00 2001 From: jacekpluta <73617938+jacekpluta@users.noreply.github.com> Date: Thu, 6 Jun 2024 21:49:36 +0200 Subject: [PATCH] [ACS-8096] Print button in the viewer does not open the print window (#9776) (#9778) --- .../src/lib/common/services/rendition.service.ts | 13 +++++-------- .../content-node-share.dialog.scss | 1 + 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/lib/content-services/src/lib/common/services/rendition.service.ts b/lib/content-services/src/lib/common/services/rendition.service.ts index 002bfe6453..e0fc85e133 100644 --- a/lib/content-services/src/lib/common/services/rendition.service.ts +++ b/lib/content-services/src/lib/common/services/rendition.service.ts @@ -257,17 +257,14 @@ export class RenditionService { printFile(url: string, type: string): void { const pwa = window.open(url, RenditionService.TARGET); if (pwa) { - // Because of the way chrome focus and close image window vs. pdf preview window - if (type === RenditionService.ContentGroup.IMAGE) { - pwa.onfocus = () => { + pwa.onload = () => { + pwa.print(); + if (type === RenditionService.ContentGroup.IMAGE) { + // Because of the way chrome focus and close image window vs. pdf preview window setTimeout(() => { pwa.close(); }, 500); - }; - } - - pwa.onload = () => { - pwa.print(); + } }; } } diff --git a/lib/content-services/src/lib/content-node-share/content-node-share.dialog.scss b/lib/content-services/src/lib/content-node-share/content-node-share.dialog.scss index 1e755c46a6..2bc22d50bb 100644 --- a/lib/content-services/src/lib/content-node-share/content-node-share.dialog.scss +++ b/lib/content-services/src/lib/content-node-share/content-node-share.dialog.scss @@ -37,6 +37,7 @@ #{$mat-form-field-infix}:has(.adf-share-link__input) { border-top: 0.9375em solid transparent; + border-bottom: 0.9375em solid transparent; height: 16px; }