mirror of
https://github.com/Foundry376/Mailspring.git
synced 2025-02-24 08:04:11 +08:00
Open links in background when ⌘ key is pressed (#1637)
When you hold down the meta key (⌘), and click on a link in a message, the target application will not activate, so N1 will stay in the foreground. Electron only supports this for OS X
This commit is contained in:
parent
5fd8faa82c
commit
08d18765d7
3 changed files with 4 additions and 4 deletions
|
@ -11,7 +11,7 @@
|
|||
"bugs": {
|
||||
"url": "https://github.com/nylas/N1/issues"
|
||||
},
|
||||
"electronVersion": "0.36.7",
|
||||
"electronVersion": "0.36.9",
|
||||
"dependencies": {
|
||||
"async": "^0.9",
|
||||
"atom-keymap": "^6.1.1",
|
||||
|
|
|
@ -151,7 +151,7 @@ class EventedIFrame extends React.Component
|
|||
target.setAttribute('href', "http://#{rawHref}")
|
||||
|
||||
e.preventDefault()
|
||||
NylasEnv.windowEventHandler.openLink(target: target)
|
||||
NylasEnv.windowEventHandler.openLink(target: target, metaKey: e.metaKey)
|
||||
|
||||
_isBlacklistedHref: (href) ->
|
||||
return (new RegExp(/^file:/i)).test(href)
|
||||
|
|
|
@ -173,7 +173,7 @@ class WindowEventHandler
|
|||
event.preventDefault()
|
||||
event.stopPropagation()
|
||||
|
||||
openLink: ({href, target, currentTarget}) ->
|
||||
openLink: ({href, target, currentTarget, metaKey}) ->
|
||||
if not href
|
||||
href = target?.getAttribute('href') or currentTarget?.getAttribute('href')
|
||||
|
||||
|
@ -191,7 +191,7 @@ class WindowEventHandler
|
|||
href = encodeURI(decodeURI(href))
|
||||
remote.getGlobal('application').openUrl(href)
|
||||
else if schema in ['http:', 'https:', 'tel:']
|
||||
shell.openExternal(href)
|
||||
shell.openExternal(href, activate: !metaKey)
|
||||
|
||||
return
|
||||
|
||||
|
|
Loading…
Reference in a new issue