The Facebook share link does not open in a popup window by Addthis and instead a full new window is opened. This is a known problem by AddThis.
In order to overcome it, we added a JavascriptEvent just after the AddThis library is loaded, like this:
// addthis.js
...
function(data, textStatus) {
addthis.init();
// Give the chance to other scripts to hook into the addthis variable.
$(document).trigger('addthis.init', addthis);
}
In a custom module we bound to the event and fixed the Facebook button's click event (thanks Michael Lablue):
$(document).bind('addthis.init', function(event, addthis) {
addthis.addEventListener('addthis.ready', function () {
$('.addthis_toolbox > .addthis_button_facebook')
.each(function (i, o) {
o.onclick = function () {
return addthis_sendto('facebook');
}
});
});
});
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | addthis-allow-hook-on-addthisready-1960656-2.patch | 797 bytes | juampynr |
Comments
Comment #1
juampynr commentedHere is a patch which triggers the addthis.init JQuery event. Other modules's JavaScript can hook into it by following the above example.
Comment #2
juampynr commentedFixing title.
Comment #3
matglas86 commentedNice. I'm committing it.
Comment #4
matglas86 commented