Class: CommentEditor

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.