From a1b3ac9497af044771c4835567ac661b8646ebf9 Mon Sep 17 00:00:00 2001 From: Chris Hallberg <crhallberg@gmail.com> Date: Mon, 16 Nov 2015 10:22:05 -0500 Subject: [PATCH] Restore recordComment ids. --- themes/bootstrap3/js/record.js | 5 +++-- themes/bootstrap3/templates/record/comments-list.phtml | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/themes/bootstrap3/js/record.js b/themes/bootstrap3/js/record.js index 49b89d9d076..083422a29a2 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 9c6ae213259..3374fadea59 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> -- GitLab