update
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user