aboutsummaryrefslogtreecommitdiffstats
path: root/apps/comments/js
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2017-11-24 16:14:53 +0100
committerGitHub <noreply@github.com>2017-11-24 16:14:53 +0100
commit892d2630fe099cb4845d9bcf740e9683c257d5d3 (patch)
tree5cd030a9ec40e6bd98215bcfe144aa14364e7acf /apps/comments/js
parent14a6fbe809b3b94ca188ba02df3347ec15327424 (diff)
parent5e6d4ad27c4795955f57a6d67179587383e22110 (diff)
downloadnextcloud-server-892d2630fe099cb4845d9bcf740e9683c257d5d3.tar.gz
nextcloud-server-892d2630fe099cb4845d9bcf740e9683c257d5d3.zip
Merge pull request #7275 from nextcloud/disable-elements-while-a-comment-is-being-deleted
Disable elements while a comment is being deleted
Diffstat (limited to 'apps/comments/js')
-rw-r--r--apps/comments/js/commentstabview.js11
1 files changed, 11 insertions, 0 deletions
diff --git a/apps/comments/js/commentstabview.js b/apps/comments/js/commentstabview.js
index 7398a709421..0d2d0b0b81f 100644
--- a/apps/comments/js/commentstabview.js
+++ b/apps/comments/js/commentstabview.js
@@ -544,9 +544,16 @@
var $comment = $(ev.target).closest('.comment');
var commentId = $comment.data('id');
var $loading = $comment.find('.submitLoading');
+ var $commentField = $comment.find('.message');
+ var $submit = $comment.find('.submit');
+ var $cancel = $comment.find('.cancel');
+ $commentField.prop('contenteditable', false);
+ $submit.prop('disabled', true);
+ $cancel.prop('disabled', true);
$comment.addClass('disabled');
$loading.removeClass('hidden');
+
this.collection.get(commentId).destroy({
success: function() {
$comment.data('commentEl').remove();
@@ -555,6 +562,10 @@
error: function() {
$loading.addClass('hidden');
$comment.removeClass('disabled');
+ $commentField.prop('contenteditable', true);
+ $submit.prop('disabled', false);
+ $cancel.prop('disabled', false);
+
OC.Notification.showTemporary(t('comments', 'Error occurred while retrieving comment with id {id}', {id: commentId}));
}
});