Commit db663e1d authored by Cecilia Vela Gurovic's avatar Cecilia Vela Gurovic Committed by Gerrit Code Review
Browse files

Merge "Bug 1802205: Needing to only handle <a> tags with href attribute"

parents 9697d11a 4bc6994a
......@@ -1072,18 +1072,20 @@ Number.isInteger = Number.isInteger || function(value) {
jQuery(function($) {
$("a").each(function() {
var url = $(this).attr('href');
if ($(this).attr('target') == '_blank' || (url.match("^http") && !url.match(config.wwwroot) && $(this).attr('target') != '_self')) {
var link = $(this);
link.removeAttr('target');
link.off('click');
link.on('click', function(e) {
e.stopPropagation();
e.preventDefault();
var newWnd = window;
newWnd.opener = null;
newWnd.open(link.prop('href'), '_blank');
});
if (typeof url !== typeof undefined && url !== false) {
if ($(this).attr('target') == '_blank' || (url.match("^http") && !url.match(config.wwwroot) && $(this).attr('target') != '_self')) {
var link = $(this);
link.removeAttr('target');
link.off('click');
link.on('click', function(e) {
e.stopPropagation();
e.preventDefault();
var newWnd = window;
newWnd.opener = null;
newWnd.open(link.prop('href'), '_blank');
});
}
}
});
});
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment