From c2c4e03e0ff59386dbdf767eebdf171ac5096417 Mon Sep 17 00:00:00 2001 From: Sam Date: Wed, 15 Oct 2014 14:49:57 +1100 Subject: [PATCH] FIX: when opening links in new window link only worked once --- app/assets/javascripts/discourse/lib/click_track.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/app/assets/javascripts/discourse/lib/click_track.js b/app/assets/javascripts/discourse/lib/click_track.js index 5ae8074320b..09a360474f0 100644 --- a/app/assets/javascripts/discourse/lib/click_track.js +++ b/app/assets/javascripts/discourse/lib/click_track.js @@ -116,6 +116,14 @@ Discourse.ClickTrack = { if (Discourse.User.currentProp('external_links_in_new_tab')) { var win = window.open(trackingUrl, '_blank'); win.focus(); + + // restore href + setTimeout(function(){ + $link.removeClass('no-href'); + $link.attr('href', $link.data('href')); + $link.data('href', null); + },50); + } else { Discourse.URL.redirectTo(trackingUrl); }