CKEDITOR.plugins.balloontoolbar.contextManager
A class for managers that take care of handling multiple contexts.
The manager also makes sure that only one toolbar is active (per manager) at a time and implement the logic used to determine the best fitting context for a given selection. Default priorities are as follows:
- Callback –
options.refresh
- Widgets matching –
options.widgets
- CSS matching –
options.cssSelector
It is worth noting that priorities could be further customized by explicitly providing CKEDITOR.plugins.balloontoolbar.contextDefinition.priority, so that it is possible to match a widget over a refresh callback.
Filtering
Properties
-
editor : editor
CKEDITOR.plugins.balloontoolbar.contextManager#editor
The editor that the manager was created for.
-
-
An array of event listener references created by the manager.An array of objects returned by the CKEDITOR.event.on method.
Defaults to
[]
Methods
-
since 4.8.0
constructor( editor ) → contextManager
CKEDITOR.plugins.balloontoolbar.contextManager#constructor
Parameters
editor : editor
The editor instance which the toolbar is created for.
Returns
contextManager
-
add( context )
CKEDITOR.plugins.balloontoolbar.contextManager#add
-
check( [ selection ] )
CKEDITOR.plugins.balloontoolbar.contextManager#check
Checks each registered context against
selection
to find the best match. By default only one toolbar per manager will be shown.Parameters
[ selection ] : selection | null
The selection to be used for probing the toolbar. If none provided, a shrunk selection of the current editor will be used.
Defaults to
null
-
create( options ) → context
CKEDITOR.plugins.balloontoolbar.contextManager#create
Creates a toolbar context based on provided
options
, registers it in the manager and returns.// Shows Bold and Underline button for any selection. var context = contextManager.create( { buttons: 'Bold,Underline', refresh: function() { return true; } } );
Parameters
options : contextDefinition
A configuration object that determines the conditions used to display the toolbar.
Returns
context
A context object created for this balloon toolbar configuration.
-
destroy()
CKEDITOR.plugins.balloontoolbar.contextManager#destroy
Destroys every context controlled by the manager and clears the context list.
-
hide()
CKEDITOR.plugins.balloontoolbar.contextManager#hide
Hides every visible context controlled by the manager.
-
Adds a set of listeners integrating the manager with the editor, like the CKEDITOR.editor.selectionChange listener.
-
Destroys any context in _contexts and empties the managed contexts list.
-
Refreshes all contexts from _contexts.