Skip to content

CommentEditor

Description

Comment editor for the Comments plugin.

Description

Initializes the comment editor, builds its DOM structure, and attaches the resize observer.

Members

CLASS_CELL

Source code

CommentEditor.CLASS_CELL

Returns the CSS class name applied to cells that have comments attached.

CLASS_EDITOR

Source code

CommentEditor.CLASS_EDITOR

Returns the CSS class name applied to the comment editor element.

CLASS_EDITOR_CONTAINER

Source code

CommentEditor.CLASS_EDITOR_CONTAINER

Returns the CSS class name applied to the outer comments container element.

CLASS_INPUT

Source code

CommentEditor.CLASS_INPUT

Returns the CSS class name applied to the comment textarea input element.

Methods

createEditor

Source code

commentEditor.createEditor() ⇒ HTMLElement

Create the textarea to be used as a comments editor.

destroy

Source code

commentEditor.destroy()

Destroy the comments editor.

focus

Source code

commentEditor.focus()

Focus the comments input element.

getEditorElement

Source code

commentEditor.getEditorElement() ⇒ HTMLElement

Get the editor element.

Returns: HTMLElement - The editor element.

getInputElement

Source code

commentEditor.getInputElement() ⇒ HTMLTextAreaElement | null

Get the input element.

getSize

Source code

commentEditor.getSize() ⇒ Object

Returns the size of the comments editor.

getValue

Source code

commentEditor.getValue() ⇒ string

Get the comment value.

hide

Source code

commentEditor.hide()

Hide the comments editor.

isFocused

Source code

commentEditor.isFocused() ⇒ boolean

Checks if the comment input element is focused.

isVisible

Source code

commentEditor.isVisible() ⇒ boolean

Checks if the editor is visible.

observeSize

Source code

commentEditor.observeSize()

Starts observing the editor size.

resetSize

Source code

commentEditor.resetSize()

Reset the editor size to its initial state.

setPosition

Source code

commentEditor.setPosition(x, y)

Set position of the comments editor according to the provided x and y coordinates.

ParamTypeDescription
xnumberX position (in pixels).
ynumberY position (in pixels).

setReadOnlyState

Source code

commentEditor.setReadOnlyState(state)

Set the read-only state for the comments editor.

ParamTypeDescription
statebooleanThe new read only state.

setSize

Source code

commentEditor.setSize(width, height)

Set the editor size according to the provided arguments.

ParamTypeDescription
widthnumberWidth in pixels.
heightnumberHeight in pixels.

setValue

Source code

commentEditor.setValue([value])

Set the comment value.

ParamTypeDescription
[value]stringoptional The value to use.

show

Source code

commentEditor.show()

Show the comments editor.