Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Config option to support pre-styled share button #224

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion src/share-button.js
Original file line number Diff line number Diff line change
Expand Up @@ -632,7 +632,14 @@ class ShareButton extends ShareUtils {
for (let network of networks) {
networkList += `<li class='${network}' data-network='${network}'><a></a></li>`;
}
instance.innerHTML = `${this.config.ui.buttonText}<div class='${this.config.ui.namespace}social load ${this.config.ui.flyout}'><ul>` + networkList + `</ul></div>`;

// Configure buttonText as false to leave button text alone
var buttonText = this.config.ui.buttonText;
if (buttonText == false) {
buttonText = instance.innerHTML;
}

instance.innerHTML = `${buttonText}<div class='${this.config.ui.namespace}social load ${this.config.ui.flyout}'><ul>` + networkList + `</ul></div>`;
}

/**
Expand Down