I'm using AddThis to render group of social media icons.
What I'm trying to achieve is to update the sharing URL only when the user clicks on any of the social media icons - this is crucial as I can't update the URL beforehand. I've tried jquery click function to update the url.
$(".addthis_sharing_toolbox").click(function () {
theUrl = window.location.origin + currentStatus;
addthis.update('share', 'url', theUrl);
});
I have also tried adding a listener
addthis.addEventListener('addthis.menu.share', addthisShare);
The problem with all of these is that they are run after addthis click event, therefore the sharing URL is not updated.
Any ideas how to solve it would be appreciated.