mirror of
https://github.com/lidarr/lidarr.git
synced 2025-07-30 03:38:26 -07:00
Fixed: External links again open in new windows.
This commit is contained in:
parent
a06a3fa5d6
commit
330554edb0
1 changed files with 9 additions and 3 deletions
|
@ -25,9 +25,15 @@ var routeBinder = {
|
||||||
var linkElement = $target.closest('a').first();
|
var linkElement = $target.closest('a').first();
|
||||||
var href = linkElement.attr('href');
|
var href = linkElement.attr('href');
|
||||||
|
|
||||||
// Set noreferrer for external links.
|
if (href && href.startsWith('http')) {
|
||||||
if (href && href.startsWith('http') && !linkElement.attr('rel')) {
|
// Set noreferrer for external links.
|
||||||
linkElement.attr('rel', 'noreferrer');
|
if (!linkElement.attr('rel')) {
|
||||||
|
linkElement.attr('rel', 'noreferrer');
|
||||||
|
}
|
||||||
|
// Open all external links in new windows.
|
||||||
|
if (!linkElement.attr('target')) {
|
||||||
|
linkElement.attr('target', '_blank');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (linkElement.hasClass('no-router') || event.type !== 'click') {
|
if (linkElement.hasClass('no-router') || event.type !== 'click') {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue