ButtonStyles Class
The ButtonStyles class provides functionality for styling a selection with a list of configurable and customizable styles. The allowed styles follow CKEDITOR.Style configuration (http://docs.ckeditor.com/#!/api/CKEDITOR.style)
Index
Methods
Properties
Methods
_checkActive
-
styleConfig
Checks if the given style definition is applied to the current selection in the editor.
Parameters:
-
styleConfig
ObjectStyle definition as per http://docs.ckeditor.com/#!/api/CKEDITOR.style.
Returns:
Returns true if the style is applied to the selection, false otherwise.
_getStyles
()
Array
protected
Returns an array of styles. Each style consists from two properties:
- name - the style name, for example "h1"
- style - an object with one property, called
element
which value represents the style which have to be applied to the element.
Returns:
An array of objects containing the styles.
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.
expanded
Boolean
Indicates whether the styles list is expanded or not.
key
String
static
The name which will be used as an alias of the button in the configuration.
Default: styles
label
String
The label that should be used for accessibility purposes.
showRemoveStylesItem
Boolean
Indicates whether the remove styles item should appear in the styles list.
styles
Array
List of the styles the button is able to handle.
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.
toggleDropdown
Function
Callback provided by the button host to notify when the styles list has been expanded.