diff --git a/themes/bootstrap3/js/record.js b/themes/bootstrap3/js/record.js index 49b89d9d076a7218043cbaae81349cdf288fd70e..083422a29a2c339b79e36f577e7dd5c9b2dea134 100644 --- a/themes/bootstrap3/js/record.js +++ b/themes/bootstrap3/js/record.js @@ -83,7 +83,7 @@ function refreshCommentList($target, recordId, recordSource) { $commentList.empty(); $commentList.append(response.data); $commentList.find('.delete').unbind('click').click(function() { - var commentId = $(this).attr('id'); + var commentId = $(this).attr('id').substr('recordComment'.length); deleteRecordComment(this, recordId, recordSource, commentId); return false; }); @@ -125,7 +125,8 @@ function registerAjaxCommentRecord() { }); // Delete links $('.delete').click(function() { - deleteRecordComment(this, $('.hiddenId').val(), $('.hiddenSource').val(), this.id.substr(13)); + var commentId = this.id.substr('recordComment'.length); + deleteRecordComment(this, $('.hiddenId').val(), $('.hiddenSource').val(), commentId); return false; }); } diff --git a/themes/bootstrap3/templates/record/comments-list.phtml b/themes/bootstrap3/templates/record/comments-list.phtml index 9c6ae213259f43924997fba4d119e6ff6f542d26..3374fadea591ef52b99ffab47c0c3b43156295fc 100644 --- a/themes/bootstrap3/templates/record/comments-list.phtml +++ b/themes/bootstrap3/templates/record/comments-list.phtml @@ -9,7 +9,7 @@ <small> <?=$this->escapeHtml($comment->created)?> <? if (($user = $this->auth()->isLoggedIn()) && $comment->user_id == $user->id): ?> - <a href="<?=$this->recordLink()->getActionUrl($this->driver, 'DeleteComment')?>?delete=<?=urlencode($comment->id)?>" id="<?=$this->escapeHtml($comment->id)?>" class="delete text-danger"><?=$this->transEsc('Delete')?></a> + <a href="<?=$this->recordLink()->getActionUrl($this->driver, 'DeleteComment')?>?delete=<?=urlencode($comment->id)?>" id="recordComment<?=$this->escapeHtml($comment->id)?>" class="delete text-danger"><?=$this->transEsc('Delete')?></a> <? endif; ?> </small> </div>