Class: EditBoxManager

CoreControls. EditBoxManager

A manager class that controls freetext annotation contents editing.

new EditBoxManager()

Extends

Methods


off( [type] [, fn])

Remove a handler of the given event name
Parameters:
Name Type Argument Description
type string | number <optional>
The name of the event to remove the handler of. If type is undefined, all the handlers of the object will be removed
fn function <optional>
The handler associated with this event to be removed. If fn is undefined, all the handlers of the given event name will be removed
Inherited From:
Returns:
Returns the object that 'off' is being called on
Type
object
Example
annotManager.off();
annotManager.off('annotationChanged');
annotManager.off('annotationChanged', fn);

on(type, fn)

Add a handler to the given event name
Parameters:
Name Type Description
type string | number The name of the event to listen to
fn function The handler to be called when the event is triggered
Inherited From:
Returns:
Returns the object that 'on' is being called on
Type
object
Example
annotManager.on('annotationChanged', (annotations, action) => {
  ...
});

one(type, fn)

Same as 'on' except the handler will be called only once
Parameters:
Name Type Description
type string | number The name of the event to listen to
fn function The handler to be called when the event is triggered
Inherited From:
Returns:
Returns the object that 'one' is being called on
Type
object
Example
annotManager.one('annotationChanged', (annotations, action) => {
 ...
});

trigger(type [, data])

Calls the handlers of the event name with given data
Parameters:
Name Type Argument Description
type string | number event name of which the handlers will be called.
data * <optional>
data that will be passed to the handlers. If data is an array, it will be spread and then passed to the handlers
Inherited From:
Returns:
Returns the object that 'trigger' is being called on
Type
object
Example
annotManager.trigger('annotationChanged');
annotManager.trigger('annotationChanged', [[annotation], 'add', {}]);

Type Definitions


Range

Type:
  • Object
Properties:
Name Type Description
index number the index of cursor
length number the number of characters that are selected

Events


editorBlur

Triggered after an editor blurred
Parameters:
Name Type Description
editor Annotations.FreeTextAnnotation.Editor an instance of Editor
annotation Annotations.FreeTextAnnotation a freetext annotation

editorFocus

Triggered after an editor is focused
Parameters:
Name Type Description
editor Annotations.FreeTextAnnotation.Editor an instance of Editor
annotation Annotations.FreeTextAnnotation a freetext annotation

editorSelectionChanged

Triggered after selection in the editor changed
Parameters:
Name Type Description
range CoreControls.EditBoxManager.Range current selected range
oldRange CoreControls.EditBoxManager.Range previous selected range

editorTextChanged

Triggered after some text in the editor changed