ButtonTwitter Class
The ButtonTwitter class provides functionality for creating a link which allows people to tweet part of the content in the editor.
Index
Methods
Methods
_getHref
()
String
protected
Generates the appropriate twitter url based on the selected text and the configuration options received via props.
Returns:
A valid twitter url with the selected text and given configuration.
getStateClasses
()
String
Returns the list of state classes associated to the current element's state, according to the results of the isActive and isDisabled methods.
Returns:
A string with the state CSS classes.
handleClick
()
Creates or removes the twitter link on the selection.
isActive
()
Boolean
Checks if the current selection is contained within a link that points to twitter.com/intent/tweet.
Returns:
True if the selection is inside a twitter link, false otherwise.
render
()
Object
Lifecycle. Renders the UI of the button.
Returns:
The content which should be rendered.
Properties
editor
Object
The editor instance where the component is being used.
key
String
static
The name which will be used as an alias of the button in the configuration.
Default: twitter
label
String
The label that should be used for accessibility purposes.
tabIndex
Number
The tabIndex of the button in its toolbar current state. A value other than -1 means that the button has focus and is the active element.