Skip to content
This repository has been archived by the owner on Jan 13, 2022. It is now read-only.

Commit

Permalink
Fixes bug in share button.
Browse files Browse the repository at this point in the history
Summary: We no longer push to this repository, I however think it's worth fixing this issue.

see https://phabricator.fb.com/D238125

Credits: mala

DiffCamp Revision: 238125

Reviewers:naitik, ray

CC:

Test Plan:
see https://phabricator.fb.com/D238125

Revert Plan:
not recommended.

Tags:
  • Loading branch information
Alok Menghrajani committed Mar 27, 2012
1 parent 80b5f21 commit 88a03e9
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions src/xfbml/tags/sharebutton.js
Expand Up @@ -111,19 +111,27 @@ FB.subclass('XFBML.ShareButton', 'XFBML.Element', null, {
classStr = 'fb_button fb_button_small';
wrapperClass = 'fb_share_count_wrapper';
}

var a_id = FB.guid();

this.dom.innerHTML = FB.String.format(
'<span class="{0}">{4}<a href="{1}" class="{2}" ' +
'onclick=\'FB.ui({6});return false;\'' +
'<span class="{0}">{4}<a id="{1}" class="{2}" ' +
'target="_blank">{3}</a>{5}</span>',
wrapperClass,
this._href,
a_id,
classStr,
contentStr,
pre,
post,
FB.JSON.stringify({ method: 'stream.share', u: this._href })
post
);

var a = document.getElementById(a_id);
a.href = this._href;
a.onclick = function() {
FB.ui({ method: 'stream.share', u: this._href });
return false;
};

if (!skipRenderEvent) {
this.fire('render');
}
Expand Down

0 comments on commit 88a03e9

Please sign in to comment.