Show:

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)

Methods

_checkActive

(
  • styleConfig
)
Boolean protected

Checks if the given style definition is applied to the current selection in the editor.

Parameters:

Returns:

Boolean:

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:

Array:

An array of objects containing the styles.

render

() Object

Lifecycle. Renders the UI of the button.

Returns:

Object:

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.