Report an issue
Class

CKEDITOR.plugins.balloontoolbar.context

class

A class representing a single balloon toolbar context in the editor.

It can be configured with various conditions for showing up the toolbar using the options parameter.

Multiple contexts are handled by the context manager.

Filtering

Properties

  • editor : editor

    An editor instance.

  • options : contextDefinition

    Options passed to the constructor.

  • toolbar : balloonToolbar

    Toolbar instance pointed by context.

Methods

  • since 4.8.0

    constructor( editor, options ) → context

    Creates a balloon toolbar context instance.

    Parameters

    editor : editor

    The editor instance for which the toolbar is created.

    options : contextDefinition

    A set of options defining the context behavior.

    Returns

    context
  • destroy()

    Destroys the toolbar maintained by this context.

  • hide()

    Hides the toolbar controlled by this context.

  • refresh()

    Refreshes the toolbar state attached to this context.

  • show( [ pointedElement ] )

    Shows the toolbar controlled by this context.

    Parameters

    [ pointedElement ] : element

    An element that should be pointed by the balloon toolbar.

  • private

    _loadButtons()

    Loads a button from options.buttons.

  • private

    _matchElement( elem ) → element | null

    Checks if a given element matches the options.cssSelector selector.

    Parameters

    elem : element

    An element to be tested.

    Returns

    element | null

    CKEDITOR.dom.element instance if an element was matched, null otherwise.

  • private

    _matchRefresh( path, selection ) → element | null

    Performs matching against options.refresh.

    Parameters

    path : elementPath

    The element path to be checked.

    selection : selection

    The selection object to be passed to the refresh function.

    Returns

    element | null

    Returns a CKEDITOR.dom.element if matched by options.refresh, null otherwise.

  • private

    _matchWidget() → element | null

    Checks if any of the options.widgets widgets is currently focused.

    Returns

    element | null

    Returns a CKEDITOR.dom.element instance that the toolbar should point to if any matched widget is focused. Returns false otherwise, which means that no tracked widget was matched.