Skip to content

Commit

Permalink
Update index.js
Browse files Browse the repository at this point in the history
  • Loading branch information
orthagonal committed Aug 9, 2024
1 parent 0abd9c6 commit 2fd7ce8
Showing 1 changed file with 2 additions and 16 deletions.
18 changes: 2 additions & 16 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -126,22 +126,8 @@ export default class SocialShareButton extends Domodule {
}

linkedinSetup() {
const params = [
`url=${encodeURIComponent(this.getShareUrl())}`
];

const shareText = this.options.text;
const shareTitle = this.options.title;

if (shareText) {
params.push(`summary=${encodeURIComponent(shareText)}`);
}

if (shareTitle) {
params.push(`title=${encodeURIComponent(shareTitle)}`);
}

this.el.href = `${BASE_URLS.linkedin}?mini=true&${params.join('&')}`;
// linkedin only allows the url param for security reasons:
this.el.href = `${BASE_URLS.linkedin}?mini=true&url=${encodeURIComponent(this.getShareUrl())}`;
}

twitterSetup() {
Expand Down

0 comments on commit 2fd7ce8

Please sign in to comment.