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
CommentEditor.CLASS_CELL
Returns the CSS class name applied to cells that have comments attached.
CLASS_EDITOR
CommentEditor.CLASS_EDITOR
Returns the CSS class name applied to the comment editor element.
CLASS_EDITOR_CONTAINER
CommentEditor.CLASS_EDITOR_CONTAINER
Returns the CSS class name applied to the outer comments container element.
CLASS_INPUT
CommentEditor.CLASS_INPUT
Returns the CSS class name applied to the comment textarea input element.
Methods
createEditor
commentEditor.createEditor() ⇒ HTMLElement
Create the textarea to be used as a comments editor.
destroy
commentEditor.destroy()
Destroy the comments editor.
focus
commentEditor.focus()
Focus the comments input element.
getEditorElement
commentEditor.getEditorElement() ⇒ HTMLElement
Get the editor element.
Returns: HTMLElement - The editor element.
getInputElement
commentEditor.getInputElement() ⇒ HTMLTextAreaElement | null
Get the input element.
getSize
commentEditor.getSize() ⇒ Object
Returns the size of the comments editor.
getValue
commentEditor.getValue() ⇒ string
Get the comment value.
hide
commentEditor.hide()
Hide the comments editor.
isFocused
commentEditor.isFocused() ⇒ boolean
Checks if the comment input element is focused.
isVisible
commentEditor.isVisible() ⇒ boolean
Checks if the editor is visible.
observeSize
commentEditor.observeSize()
Starts observing the editor size.
resetSize
commentEditor.resetSize()
Reset the editor size to its initial state.
setPosition
commentEditor.setPosition(x, y)
Set position of the comments editor according to the provided x and y coordinates.
| Param | Type | Description |
|---|---|---|
| x | number | X position (in pixels). |
| y | number | Y position (in pixels). |
setReadOnlyState
commentEditor.setReadOnlyState(state)
Set the read-only state for the comments editor.
| Param | Type | Description |
|---|---|---|
| state | boolean | The new read only state. |
setSize
commentEditor.setSize(width, height)
Set the editor size according to the provided arguments.
| Param | Type | Description |
|---|---|---|
| width | number | Width in pixels. |
| height | number | Height in pixels. |
setValue
commentEditor.setValue([value])
Set the comment value.
| Param | Type | Description |
|---|---|---|
| [value] | string | optional The value to use. |
show
commentEditor.show()
Show the comments editor.