FIX: when opening links in new window link only worked once

This commit is contained in:
Sam 2014-10-15 14:49:57 +11:00
parent 01bb2d4c31
commit c2c4e03e0f
1 changed files with 8 additions and 0 deletions

View File

@ -116,6 +116,14 @@ Discourse.ClickTrack = {
if (Discourse.User.currentProp('external_links_in_new_tab')) { if (Discourse.User.currentProp('external_links_in_new_tab')) {
var win = window.open(trackingUrl, '_blank'); var win = window.open(trackingUrl, '_blank');
win.focus(); win.focus();
// restore href
setTimeout(function(){
$link.removeClass('no-href');
$link.attr('href', $link.data('href'));
$link.data('href', null);
},50);
} else { } else {
Discourse.URL.redirectTo(trackingUrl); Discourse.URL.redirectTo(trackingUrl);
} }