Added edit comment button.

This commit is contained in:
Pierre 2018-01-25 06:58:26 +01:00
parent 2065cc03d7
commit 9399b89e34
2 changed files with 23 additions and 4 deletions

View File

@ -18,11 +18,13 @@
float: none;
}
.post-comments .delete-comment-link {
.post-comments .delete-comment-link,
.post-comments .edit-comment-link {
margin-left: 5px;
color: #b5bbc8;
}
.post-comments .delete-comment-link:active {
.post-comments .delete-comment-link:active,
.post-comments .edit-comment-link:active {
color: black;
}

View File

@ -110,9 +110,26 @@ ComunicWeb.components.comments.ui = {
innerHTML: ComunicWeb.common.date.timeDiffToStr(infos.time_sent) + " ago"
});
//Offer the user the possibility to delete the comment if he is allowed to do so
//Offer the user the possibility to delete and update the comment if he is allowed to do so
if(userID() == infos.userID){
//Create a button to update the comment
var editCommentLink = createElem2({
appendTo: rightContener,
type: "a",
class: "edit-comment-link"
});
createElem2({
appendTo: deleteCommentLink,
type: "i",
class: "fa fa-edit"
});
//Make edit button lives
//Open in editor (separate file)
//Create a button to delete the comment
var deleteCommentLink = createElem2({
appendTo: rightContener,
@ -126,7 +143,7 @@ ComunicWeb.components.comments.ui = {
class: "fa fa-trash"
});
//Make button lives
//Make delete button lives
deleteCommentLink.onclick = function(){
ComunicWeb.common.messages.confirm("Are you sure do you want to delete this comment ? This operation is unrecoverable!", function(response){