Fix input field not disabled while a comment is being sent

Since the change of the text area to a content editable div the input
field was no longer disabled while a new comment was being sent. It was
caused by still trying to disable the div using the "disabled" property,
which works only on real input fields; when using a content editable div
the way to disable it is by setting "contenteditable" to "false".

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
This commit is contained in:
Daniel Calviño Sánchez 2017-11-23 14:34:09 +01:00
parent b6a39b7927
commit bbe00079cc
1 changed files with 3 additions and 3 deletions

View File

@ -320,7 +320,7 @@
this.$container.append($comment);
}
this._postRenderItem($comment);
$('#commentsTabView').find('.newCommentForm div.message').text('').prop('disabled', false);
$('#commentsTabView').find('.newCommentForm div.message').text('').prop('contenteditable', true);
// we need to update the model, because it consists of client data
// only, but the server might add meta data, e.g. about mentions
@ -620,7 +620,7 @@
return;
}
$commentField.prop('disabled', true);
$commentField.prop('contenteditable', false);
$submit.addClass('hidden');
$loading.removeClass('hidden');
@ -673,7 +673,7 @@
_onSubmitError: function($form, commentId) {
$form.find('.submit').removeClass('hidden');
$form.find('.submitLoading').addClass('hidden');
$form.find('.message').prop('disabled', false);
$form.find('.message').prop('contenteditable', true);
if(!_.isUndefined(commentId)) {
OC.Notification.show(t('comments', 'Error occurred while updating comment with id {id}', {id: commentId}), {type: 'error'});