mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-04-22 08:26:16 -04:00
On Ctrl+Click bring the window back to focus (#6456)
This commit is contained in:
parent
68fbaf7982
commit
d5552b037c
1 changed files with 2 additions and 1 deletions
|
@ -2248,7 +2248,7 @@ function Ace2Inner(editorInfo, cssManagers) {
|
|||
const isLink = (n) => (n.tagName || '').toLowerCase() === 'a' && n.href;
|
||||
|
||||
// only want to catch left-click
|
||||
if ((!evt.ctrlKey) && (evt.button !== 2) && (evt.button !== 3)) {
|
||||
if ((evt.button !== 2) && (evt.button !== 3)) {
|
||||
// find A tag with HREF
|
||||
let n = evt.target;
|
||||
while (n && n.parentNode && !isLink(n)) {
|
||||
|
@ -2257,6 +2257,7 @@ function Ace2Inner(editorInfo, cssManagers) {
|
|||
if (n && isLink(n)) {
|
||||
try {
|
||||
window.open(n.href, '_blank', 'noopener,noreferrer');
|
||||
if (evt.ctrlKey) window.focus();
|
||||
} catch (e) {
|
||||
// absorb "user canceled" error in IE for certain prompts
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue