update
This commit is contained in:
@@ -950,7 +950,23 @@ export class DeesPdfViewer extends DeesElement {
|
|||||||
* Provide context menu items for right-click functionality
|
* Provide context menu items for right-click functionality
|
||||||
*/
|
*/
|
||||||
public getContextMenuItems() {
|
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',
|
name: 'Open PDF in New Tab',
|
||||||
iconName: 'lucide:ExternalLink',
|
iconName: 'lucide:ExternalLink',
|
||||||
@@ -961,7 +977,7 @@ export class DeesPdfViewer extends DeesElement {
|
|||||||
{ divider: true },
|
{ divider: true },
|
||||||
{
|
{
|
||||||
name: 'Copy PDF URL',
|
name: 'Copy PDF URL',
|
||||||
iconName: 'lucide:Copy',
|
iconName: 'lucide:Link',
|
||||||
action: async () => {
|
action: async () => {
|
||||||
await navigator.clipboard.writeText(this.pdfUrl);
|
await navigator.clipboard.writeText(this.pdfUrl);
|
||||||
}
|
}
|
||||||
@@ -980,7 +996,9 @@ export class DeesPdfViewer extends DeesElement {
|
|||||||
this.printPdf();
|
this.printPdf();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
];
|
);
|
||||||
|
|
||||||
|
return items;
|
||||||
}
|
}
|
||||||
|
|
||||||
private get canZoomIn(): boolean {
|
private get canZoomIn(): boolean {
|
||||||
|
|||||||
Reference in New Issue
Block a user