mirror of
https://github.com/Foundry376/Mailspring.git
synced 2025-01-10 18:23:21 +08:00
fix(menus): Customize context menu for mailto #2061
This commit is contained in:
parent
e269dc2598
commit
d64fd03c53
1 changed files with 6 additions and 2 deletions
|
@ -205,8 +205,12 @@ class EventedIFrame extends React.Component
|
|||
linkTarget = @_getContainingTarget(event, {with: 'href'})
|
||||
if linkTarget
|
||||
href = linkTarget.getAttribute('href')
|
||||
menu.append(new MenuItem({ label: "Open Link", click:( -> NylasEnv.windowEventHandler.openLink({href}) )}))
|
||||
menu.append(new MenuItem({ label: "Copy Link", click:( -> clipboard.writeText(href) )}))
|
||||
if href.startsWith('mailto')
|
||||
menu.append(new MenuItem({ label: "Compose Message...", click:( -> NylasEnv.windowEventHandler.openLink({href}) )}))
|
||||
menu.append(new MenuItem({ label: "Copy Email Address", click:( -> clipboard.writeText(href.split('mailto:').pop()) )}))
|
||||
else
|
||||
menu.append(new MenuItem({ label: "Open Link", click:( -> NylasEnv.windowEventHandler.openLink({href}) )}))
|
||||
menu.append(new MenuItem({ label: "Copy Link", click:( -> clipboard.writeText(href) )}))
|
||||
menu.append(new MenuItem({ type: 'separator' }))
|
||||
|
||||
# Menu actions for images
|
||||
|
|
Loading…
Reference in a new issue