summaryrefslogtreecommitdiffstats
path: root/apps/comments/js
diff options
context:
space:
mode:
authorDaniel Calviño Sánchez <danxuliu@gmail.com>2017-11-23 14:34:09 +0100
committerDaniel Calviño Sánchez <danxuliu@gmail.com>2017-11-23 14:34:09 +0100
commitbbe00079cc948fd7f9e96be15688e23feb8367c1 (patch)
tree31802005a369137c7aa615578d3b121ab990c22f /apps/comments/js
parentb6a39b79278df848af388506cce394671a414f19 (diff)
downloadnextcloud-server-bbe00079cc948fd7f9e96be15688e23feb8367c1.tar.gz
nextcloud-server-bbe00079cc948fd7f9e96be15688e23feb8367c1.zip
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>
Diffstat (limited to 'apps/comments/js')
-rw-r--r--apps/comments/js/commentstabview.js6
1 files changed, 3 insertions, 3 deletions
diff --git a/apps/comments/js/commentstabview.js b/apps/comments/js/commentstabview.js
index 7398a709421..0f5465600d1 100644
--- a/apps/comments/js/commentstabview.js
+++ b/apps/comments/js/commentstabview.js
@@ -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'});