Config option to support pre-styled share button#224
Config option to support pre-styled share button#224mahemoff wants to merge 4 commits intocarrot:masterfrom
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. |
src/ShareButton.js
Outdated
|
|
||
| // 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.
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 })