From d5552b037c18007f9709315f3df6802363e4ed61 Mon Sep 17 00:00:00 2001 From: Helder Sepulveda Date: Sun, 16 Jun 2024 13:27:05 -0400 Subject: [PATCH] On Ctrl+Click bring the window back to focus (#6456) --- src/static/js/ace2_inner.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/static/js/ace2_inner.js b/src/static/js/ace2_inner.js index e64c8695d..868906cfd 100644 --- a/src/static/js/ace2_inner.js +++ b/src/static/js/ace2_inner.js @@ -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 }