CKEDITOR.plugins.balloontoolbar.context
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
-
An editor instance.
-
Options passed to the constructor.
-
Toolbar instance pointed by context.
Methods
-
constructor( editor, options ) → context
since 4.8.0
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
-
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.
-
_loadButtons()
private
Loads a button from
options.buttons
. -
_matchElement( elem ) → element | null
private
Checks if a given
element
matches theoptions.cssSelector
selector.Parameters
elem : element
An element to be tested.
Returns
element | null
CKEDITOR.dom.element instance if an element was matched,
null
otherwise.
-
_matchRefresh( path, selection ) → element | null
private
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.
-
_matchWidget() → element | null
private
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.