Detect and handle remote links

Currently they trigger XHR requests if not given a special target.

fixes #6159
This commit is contained in:
Thomas Gelf 2014-05-09 11:04:00 +00:00
parent c93564c797
commit e70ca26427
1 changed files with 2 additions and 3 deletions

View File

@ -418,11 +418,10 @@
var $target;
var isMenuLink = $a.closest('#menu').length > 0;
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
if (linkTarget === '_blank' || linkTarget === '_self') {
if (linkTarget === '_blank' || linkTarget === '_self' || href.match(remote)) {
window.open(href, linkTarget);
return false;
}