From 0a83f0e136f0f95a4b22b65ccc3a572f203d1cff Mon Sep 17 00:00:00 2001 From: Juergen Kunz Date: Wed, 28 Jan 2026 17:10:37 +0000 Subject: [PATCH] update --- .../dees-pdf-viewer/component.ts | 24 ++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/ts_web/elements/00group-media/dees-pdf-viewer/component.ts b/ts_web/elements/00group-media/dees-pdf-viewer/component.ts index 4d28135..4587ac8 100644 --- a/ts_web/elements/00group-media/dees-pdf-viewer/component.ts +++ b/ts_web/elements/00group-media/dees-pdf-viewer/component.ts @@ -950,7 +950,23 @@ export class DeesPdfViewer extends DeesElement { * Provide context menu items for right-click functionality */ public getContextMenuItems() { - return [ + const items: any[] = []; + + // Add copy option if text is selected + const selection = window.getSelection(); + const selectedText = selection?.toString() || ''; + if (selectedText) { + items.push({ + name: 'Copy', + iconName: 'lucide:Copy', + action: async () => { + await navigator.clipboard.writeText(selectedText); + } + }); + items.push({ divider: true }); + } + + items.push( { name: 'Open PDF in New Tab', iconName: 'lucide:ExternalLink', @@ -961,7 +977,7 @@ export class DeesPdfViewer extends DeesElement { { divider: true }, { name: 'Copy PDF URL', - iconName: 'lucide:Copy', + iconName: 'lucide:Link', action: async () => { await navigator.clipboard.writeText(this.pdfUrl); } @@ -980,7 +996,9 @@ export class DeesPdfViewer extends DeesElement { this.printPdf(); } } - ]; + ); + + return items; } private get canZoomIn(): boolean {