#200 edit comment fixes

This commit is contained in:
Hamid Reza Mohammadi 2021-09-09 16:06:48 +04:30
parent 476761986d
commit 288cf550f0
3 changed files with 12 additions and 2 deletions

View File

@ -269,10 +269,11 @@
}
function editMyComment(commentId) {
function editMyComment(commentId, coupletIndex) {
var commentTextBlockId = '#comment-text-' + commentId;
tinymce.get('editCommentText').setContent($(commentTextBlockId).html());
$("#editCommentId").val(commentId);
$("#editCommentCoupletIndex").val(coupletIndex);
document.getElementById('id02').style.display = 'block';
}
@ -286,6 +287,7 @@
var url = '?handler=MyComment';
var commentId = $("#editCommentId").val();
var coupletIndex = $("#editCommentCoupletIndex").val();
$.ajax({
@ -301,6 +303,13 @@
var commentTextBlockId = '#comment-text-' + commentId;
$(commentTextBlockId).html($("textarea#editCommentText").val());
if (coupletIndex != '-1') {
var bnumCommentBlockId = '#comment-text-' + commentId + "-" + coupletIndex;
if ($(bnumCommentBlockId) != null) {
$(bnumCommentBlockId).html($("textarea#editCommentText").val());
}
}
},
});

View File

@ -35,7 +35,7 @@ else
@if (Model.Comment.MyComment)
{
<a role="button" onclick="deleteMyComment(@Model.Comment.Id, '@Model.Comment.CoupletIndex')" class="actionlink" title="حذف حاشیه">🗑</a>
<a role="button" onclick="editMyComment(@Model.Comment.Id)" class="actionlink" title="ویرایش حاشیه">✎</a>
<a role="button" onclick="editMyComment(@Model.Comment.Id, '@Model.Comment.CoupletIndex')" class="actionlink" title="ویرایش حاشیه">✎</a>
}
<a role="button" onclick="replyComment(@Model.Comment.Id, @(Model.LoggedIn ? "true" : "false"), '@Model.DivSuffix')" class="actionlink" title="پاسخگویی به این حاشیه">⤶</a>

View File

@ -454,6 +454,7 @@
<td>
<textarea name="editCommentText" id="editCommentText" class="inputTextarea editor" tabindex="4" rows="10" style="width:100%"></textarea>
<input type="hidden" name="editCommentId" id="editCommentId" value="" />
<input type="hidden" name="editCommentCoupletIndex" id="editCommentCoupletIndex" value="" />
</td>
</tr>
<tr>