Commit 4bc6994a authored by Robert Lyon's avatar Robert Lyon
Browse files

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



We should ignore the <a name="x"></a> links

behatnotneeded

Change-Id: I3e7031bbb7a7e5da99493ebd36206d4c2d2445a2
Signed-off-by: Robert Lyon's avatarRobert Lyon <robertl@catalyst.net.nz>
parent 7479e5d7
......@@ -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