CommentEditor

Comment editor for the Comments plugin.

Methods

createEditor(){HTMLElement}

Create the textarea to be used as a comments editor.

Returns: {HTMLElement}

destroy()

Destroy the comments editor.

focus()

Focus the comments input element.

getInputElement(){HTMLElement}

Get the input element.

Returns: {HTMLElement}

getValue(){string}

Get the comment value.

Returns: {string}

hide()

Hide the comments editor.

isFocused(){boolean}

Checks if the comment input element is focused.

Returns: {boolean}

isVisible(){boolean}

Checks if the editor is visible.

Returns: {boolean}

resetSize()

Reset the editor size to its initial state.

setPosition(x, y)

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

Parameters:
Name Type Description
x number

X position (in pixels).

y number

Y position (in pixels).

setReadOnlyState(state)

Set the read-only state for the comments editor.

Parameters:
Name Type Description
state boolean

The new read only state.

setSize(width, height)

Set the editor size according to the provided arguments.

Parameters:
Name Type Description
width number

Width in pixels.

height number

Height in pixels.

setValue(value)

Set the comment value.

Parameters:
Name Type Description
value string optional

The value to use.

show()

Show the comments editor.

Class: CommentEditor