mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-25 23:04:51 +02:00
Detect and handle remote links
Currently they trigger XHR requests if not given a special target. fixes #6159
This commit is contained in:
parent
c93564c797
commit
e70ca26427
@ -418,11 +418,10 @@
|
|||||||
var $target;
|
var $target;
|
||||||
var isMenuLink = $a.closest('#menu').length > 0;
|
var isMenuLink = $a.closest('#menu').length > 0;
|
||||||
var formerUrl;
|
var formerUrl;
|
||||||
|
var remote = /^(?:[a-z]+:)\/\//;
|
||||||
|
|
||||||
// TODO: Let remote links pass through. Right now they only work
|
|
||||||
// combined with target="_blank" or target="_self"
|
|
||||||
// window.open is used as return true; didn't work reliable
|
// window.open is used as return true; didn't work reliable
|
||||||
if (linkTarget === '_blank' || linkTarget === '_self') {
|
if (linkTarget === '_blank' || linkTarget === '_self' || href.match(remote)) {
|
||||||
window.open(href, linkTarget);
|
window.open(href, linkTarget);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user