diff --git a/model/comment.class.php b/model/comment.class.php index 077f4539d5644649338df60bae515a36ce27ba7e..dbfa17e4affca7a92620b31ea4c41558b35b4e4b 100644 --- a/model/comment.class.php +++ b/model/comment.class.php @@ -388,7 +388,8 @@ class pdfannotator_comment { $DB->delete_records('pdfannotator_votes', array("commentid" => $commentid)); 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 { return ['status' => 'error']; } diff --git a/shared/index.js b/shared/index.js index 0b96cd01b0b2b1c64cbbf7daa9dbe7975f0361ac..f57f89f14e3c84805c9c3d8ecdeaf6be816a073c 100644 --- a/shared/index.js +++ b/shared/index.js @@ -340,11 +340,17 @@ function startIndex(Y,_cm,_documentObject,_userid,_capabilities, _toolbarSetting $('#comment_'+commentId+' .chat-message-meta .user').remove(); $('#comment_'+commentId+' .countVotes').remove(); $('#comment_'+commentId+' .comment-like-a').attr("disabled","disabled").css("visibility", "hidden"); - $('#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-edit-a').remove(); $('#comment_'+commentId+' .edited').remove(); - }else{ + 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-delete-a').remove(); + $('#comment_'+commentId+' .chat-message-meta .dropdown .comment-edit-a').remove(); + $('#comment_'+commentId+' .chat-message-meta .dropdown .comment-forward-a').remove(); + $('#comment_'+commentId+' .chat-message-meta .dropdown #hidebutton'+commentId).remove(); + } + } else { var parent = child.parentNode; parent.removeChild(child); }