components.CommentForm Class
Two mode comment form
When single line mode
- Enter key submits the value
- Shift+Enter forces a line break and enables the multiline mode
When in multiline mode:
- Enter key adds an additional line break
- Ctrl+Enter submits the value
Constructor
components.CommentForm
(
-
props
Parameters:
-
propsObject-
[onSubmit]Function optionalCalled when the form is submitted with the button or the keyboard shortcut
-
Item Index
Methods
_submit
()
private
Emit onSubmit event with the current textarea value
_submit
()
private
Emit onSubmit event with the current textarea value
_submit
()
private
Emit onSubmit event with the current textarea value
clear
()
Clear the textarea
clear
()
Clear the textarea
clear
()
Clear the textarea
getValue
()
String
Get the textarea value
Returns:
String:
getValue
()
String
Get the textarea value
Returns:
String:
getValue
()
String
Get the textarea value
Returns:
String:
hasComment
()
Boolean
Return true if the textarea has a proper comment
Returns:
Boolean:
hasComment
()
Boolean
Return true if the textarea has a proper comment
Returns:
Boolean:
hasComment
()
Boolean
Return true if the textarea has a proper comment
Returns:
Boolean:
setBackbone
(
-
attrs -
cb
Like React setState but assumes all values to be Backbone event emitters.
Listens for replace events. The first event argument is assumed to be
a replacement event emitter for the given key.
Parameters:
-
attrsObject -
cbFunction
