Skip to content
Snippets Groups Projects
Commit a8e74347 authored by Friederike Schwager's avatar Friederike Schwager Committed by Friederike Schwager
Browse files

clean-up comment.php, fix dropdown for deleted comments

parent f1941319
No related branches found
No related tags found
No related merge requests found
...@@ -388,7 +388,8 @@ class pdfannotator_comment { ...@@ -388,7 +388,8 @@ class pdfannotator_comment {
$DB->delete_records('pdfannotator_votes', array("commentid" => $commentid)); $DB->delete_records('pdfannotator_votes', array("commentid" => $commentid));
if ($success == 1) { if ($success == 1) {
return ['status' => 'success', 'wasanswered' => $wasanswered, 'followups' => $tobedeletedaswell, 'deleteannotation' => $deleteannotation]; return ['status' => 'success', 'wasanswered' => $wasanswered, 'followups' => $tobedeletedaswell,
'deleteannotation' => $deleteannotation, 'isquestion' => $comment->isquestion];
} else { } else {
return ['status' => 'error']; return ['status' => 'error'];
} }
......
...@@ -340,10 +340,16 @@ function startIndex(Y,_cm,_documentObject,_userid,_capabilities, _toolbarSetting ...@@ -340,10 +340,16 @@ function startIndex(Y,_cm,_documentObject,_userid,_capabilities, _toolbarSetting
$('#comment_'+commentId+' .chat-message-meta .user').remove(); $('#comment_'+commentId+' .chat-message-meta .user').remove();
$('#comment_'+commentId+' .countVotes').remove(); $('#comment_'+commentId+' .countVotes').remove();
$('#comment_'+commentId+' .comment-like-a').attr("disabled","disabled").css("visibility", "hidden"); $('#comment_'+commentId+' .comment-like-a').attr("disabled","disabled").css("visibility", "hidden");
$('#comment_'+commentId+' .edited').remove();
if (data.isquestion == 0) {
$('#comment_'+commentId+' .dropdown').remove();
} else {
$('#comment_'+commentId+' .chat-message-meta .dropdown .comment-report-button').remove(); $('#comment_'+commentId+' .chat-message-meta .dropdown .comment-report-button').remove();
$('#comment_'+commentId+' .chat-message-meta .dropdown .comment-delete-a').remove(); $('#comment_'+commentId+' .chat-message-meta .dropdown .comment-delete-a').remove();
$('#comment_'+commentId+' .chat-message-meta .dropdown .comment-edit-a').remove(); $('#comment_'+commentId+' .chat-message-meta .dropdown .comment-edit-a').remove();
$('#comment_'+commentId+' .edited').remove(); $('#comment_'+commentId+' .chat-message-meta .dropdown .comment-forward-a').remove();
$('#comment_'+commentId+' .chat-message-meta .dropdown #hidebutton'+commentId).remove();
}
} else { } else {
var parent = child.parentNode; var parent = child.parentNode;
parent.removeChild(child); parent.removeChild(child);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment