Enter button now triggers comment submission
This commit is contained in:
@ -77,8 +77,10 @@
|
||||
.appendTo($(this).closest('.media-body-wrapper'));
|
||||
var text_max = 140;
|
||||
$('#textarea-comment-feedback').html(text_max + ' characters remaining');
|
||||
$('#comment-to-comment-textinput').keyup(function () {
|
||||
console.log('I should be showing characters remaining');
|
||||
$('#comment-to-comment-textinput').keyup(function (e) {
|
||||
if (e.which === 13 || e === 13) {
|
||||
$('#submit-comment-to-comment').click();
|
||||
}
|
||||
var text_length = $('#comment-to-comment-textinput').val().length;
|
||||
var text_remaining = text_max - text_length;
|
||||
$('#textarea-comment-feedback').html(text_remaining + ' characters remaining');
|
||||
@ -89,7 +91,7 @@
|
||||
{
|
||||
data: {
|
||||
associatedPost: commentId,
|
||||
body: $('#comment-to-comment-textarea').val(),
|
||||
body: $('#comment-to-comment-textinput').val(),
|
||||
author: {
|
||||
picture: user.profile.picture,
|
||||
userId: user._id,
|
||||
|
@ -51,7 +51,10 @@
|
||||
});
|
||||
var text_max = 140;
|
||||
$('#textarea_feedback').html(text_max + ' characters remaining');
|
||||
$('#comment-box').keyup(function () {
|
||||
$('#comment-box').keyup(function (e) {
|
||||
if (e.which === 13 || e === 13) {
|
||||
$('#comment-button').click();
|
||||
}
|
||||
var text_length = $('#comment-box').val().length;
|
||||
var text_remaining = text_max - text_length;
|
||||
$('#textarea_feedback').html(text_remaining + ' characters remaining');
|
||||
|
Reference in New Issue
Block a user