Class: ContentEditManager

Core. ContentEditManager

A manager class that controls document content editing

new ContentEditManager()

Extends

  • EventHandler

Methods


endContentEditMode()

Ends the Content Edit mode, re-enabling links and removing content edit boxes from the document.

getContentBoxAttributes(contentBoxId)

Gets the text attributes applied to the content edit box.
Parameters:
Name Type Description
contentBoxId string The id of the content box.
Returns:
Resolves to an object of text attrbutes.
Type
Promise.<Object>

getContentBoxById(id)

Gets a content box instance by its id.
Parameters:
Name Type Description
id string The content box ID
Returns:
The content box instance
Type
Core.ContentEdit.ContentBox

isInContentEditMode()

Gets if the Content Edit manager is currently in content edit mode
Returns:
Type
boolean

startContentEditMode()

Starts the Content Edit mode, a mode in which links are disabled and boxes are drawn around all editable content so users can edit them

toggleInvisibleCharacters()

Toggles the visibility of invisible characters in the content edit boxes

Events


contentBoxEditEnded

Triggered when a Content edit box has ended being edited.

contentBoxEditStarted

Triggered when a Content edit box has started being edited.
Returns:
The content box editor instance.
Type
Core.ContentEdit.ContentBoxEditor

contentEditDocumentDigitallySigned

Triggered when a document is digital signed in Content Edit mode.

contentEditModeEnded

Triggered when Content Edit mode is ended.

contentEditModeStarted

Triggered when Content Edit mode is started.

contentEditSelectionChange

Triggered when a text selection has changed in a content edit box.
Type: SelectionChangeEvent
Parameters:
Name Type Description
selectionChangeEvent object The JavaScript event object for the native selectionchange event.
Example
const { Core } = instance;
const { documentViewer } = Core;
const contentEditManager = documentViewer.getContentEditManager();
contentEditManager.addEventListener('contentEditSelectionChange', (selectionChangeEvent) => {
 console.log(selectionChangeEvent.event.target.getSelection().toString());
});