Skip to content

Commit edb2140

Browse files
committed
Target_Blank option to open External links
1 parent f99a895 commit edb2140

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

core/src/components/MainMenu.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ export const setUp = () => {
7272
if (!$app.is('a')) {
7373
$app = $app.closest('a')
7474
}
75-
if (event.which === 1 && !event.ctrlKey && !event.metaKey) {
75+
if (event.which === 1 && !event.ctrlKey && !event.metaKey && $app.attr('target') !== '_blank') {
7676
$app.find('svg').remove()
7777
$app.find('div').remove() // prevent odd double-clicks
7878
// no need for theming, loader is already inverted on dark mode
@@ -100,7 +100,7 @@ export const setUp = () => {
100100
$app = $app.closest('a')
101101
}
102102

103-
if (event.which === 1 && !event.ctrlKey && !event.metaKey && $app.parent('#more-apps').length === 0) {
103+
if (event.which === 1 && !event.ctrlKey && !event.metaKey && $app.parent('#more-apps').length === 0 && $app.attr('target') !== '_blank') {
104104
$app.find('svg').remove()
105105
$app.find('div').remove() // prevent odd double-clicks
106106
$app.prepend($('<div/>').addClass(

core/templates/layout.user.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@
5555
<?php foreach ($_['navigation'] as $entry): ?>
5656
<li data-id="<?php p($entry['id']); ?>" class="hidden" tabindex="-1">
5757
<a href="<?php print_unescaped($entry['href']); ?>"
58+
<?php if ($entry['target']): ?> target="_blank"<?php endif; ?>
5859
<?php if ($entry['active']): ?> class="active"<?php endif; ?>
5960
aria-label="<?php p($entry['name']); ?>">
6061
<svg width="24" height="20" viewBox="0 0 24 20" alt=""<?php if ($entry['unread'] !== 0) { ?> class="has-unread"<?php } ?>>
@@ -91,6 +92,7 @@
9192
<?php foreach ($_['navigation'] as $entry): ?>
9293
<li data-id="<?php p($entry['id']); ?>">
9394
<a href="<?php print_unescaped($entry['href']); ?>"
95+
<?php if ($entry['target']): ?> target="_blank"<?php endif; ?>
9496
<?php if ($entry['active']): ?> class="active"<?php endif; ?>
9597
aria-label="<?php p($entry['name']); ?>">
9698
<svg width="20" height="20" viewBox="0 0 20 20" alt=""<?php if ($entry['unread'] !== 0) { ?> class="has-unread"<?php } ?>>

0 commit comments

Comments
 (0)