mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-24 08:09:13 -05:00
FIX: when opening links in new window link only worked once
This commit is contained in:
parent
01bb2d4c31
commit
c2c4e03e0f
1 changed files with 8 additions and 0 deletions
|
@ -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);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue