-
Notifications
You must be signed in to change notification settings - Fork 381
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
base: master
Are you sure you want to change the base?
Conversation
This adds the possibility of setting buttonText to false, which will suppress the default "Share" text being injected into the button. Benefits: (a) allows the page author to pre-style the button as part of the general page HTML and CSS; (b) prevents a Flash Of Unwanted Content. Usage: new ShareButton(ui: { buttonText: false })
@mahemoff when the share-button loads locally I don't get a flash. I'm assuming you want to do something like this: <share-button>FooBar</share-button> This would display FooBar instead of Share. |
@hhsnopek Correct, I'm using this so I can render the contents manually. As far as the flash, if it's generated by JavaScript, there can be a flash if the JavaScript takes a while to load. |
|
||
// Configure buttonText as false to leave button text alone | ||
var buttonText = this.config.ui.buttonText; | ||
if (buttonText==false) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could you add spacing around the ==
comparison for me? - this'll be good to go after that 😄
Also you'll have to rebase master on top of this, then we're set to merge 😄 - sorry for the wait! |
No worries, should be ready now. |
Oops looks like you might have ran |
This adds the possibility of setting buttonText to false, which will
suppress the default "Share" text being injected into the button.
Benefits: (a) allows the page author to pre-style the button as part of
the general page HTML and CSS; (b) prevents a Flash Of Unwanted Content.
Usage:
new ShareButton(ui: { buttonText: false })