From d81256a453d2b3723e4b5902afbe7ac510e88250 Mon Sep 17 00:00:00 2001 From: christophe canovas Date: Wed, 30 Jun 2021 12:34:35 +0200 Subject: [PATCH] Target_Blank option to open External links Signed-off-by: christophe canovas --- core/src/components/MainMenu.js | 4 ++-- core/templates/layout.user.php | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/core/src/components/MainMenu.js b/core/src/components/MainMenu.js index 3b7fef6afca6e..23b75c1610ee5 100644 --- a/core/src/components/MainMenu.js +++ b/core/src/components/MainMenu.js @@ -72,7 +72,7 @@ export const setUp = () => { if (!$app.is('a')) { $app = $app.closest('a') } - if (event.which === 1 && !event.ctrlKey && !event.metaKey) { + if (event.which === 1 && !event.ctrlKey && !event.metaKey && $app.attr('target') !== '_blank') { $app.find('svg').remove() $app.find('div').remove() // prevent odd double-clicks // no need for theming, loader is already inverted on dark mode @@ -100,7 +100,7 @@ export const setUp = () => { $app = $app.closest('a') } - if (event.which === 1 && !event.ctrlKey && !event.metaKey && $app.parent('#more-apps').length === 0) { + if (event.which === 1 && !event.ctrlKey && !event.metaKey && $app.parent('#more-apps').length === 0 && $app.attr('target') !== '_blank') { $app.find('svg').remove() $app.find('div').remove() // prevent odd double-clicks $app.prepend($('
').addClass( diff --git a/core/templates/layout.user.php b/core/templates/layout.user.php index c9ca4e23110cc..3440358c61f90 100644 --- a/core/templates/layout.user.php +++ b/core/templates/layout.user.php @@ -69,6 +69,7 @@
  • target="_blank" rel="noreferrer noopener" class="active" aria-label=""> class="has-unread">