浏览代码

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>
tags/v13.0.0beta2
Daniel Calviño Sánchez 6 年前
父节点
当前提交
bbe00079cc
共有 1 个文件被更改,包括 3 次插入3 次删除
  1. 3
    3
      apps/comments/js/commentstabview.js

+ 3
- 3
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'});

正在加载...
取消
保存