From 2671081e89ab1348453b124c4e2aceef93ff0a97 Mon Sep 17 00:00:00 2001 From: lisaq Date: Fri, 29 Jul 2016 16:20:48 +0200 Subject: [PATCH] pull requests: add show/hide comment functionality #4106 --- .../pullrequests/pullrequest_show.html | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/rhodecode/templates/pullrequests/pullrequest_show.html b/rhodecode/templates/pullrequests/pullrequest_show.html index 8c95b39a..6c3d011e 100644 --- a/rhodecode/templates/pullrequests/pullrequest_show.html +++ b/rhodecode/templates/pullrequests/pullrequest_show.html @@ -311,6 +311,10 @@ %endif + @@ -559,6 +563,23 @@ $('#close_pull_request').on('click', function(e){ closePullRequest("${c.repo_name}", "${c.pull_request.pull_request_id}"); }); + + $('.show-inline-comments').on('click', function(e){ + var boxid = $(this).attr('data-comment-id'); + var button = $(this); + + if(button.hasClass("comments-visible")) { + $('#{0} .inline-comments'.format(boxid)).each(function(index){ + $(this).hide(); + }) + button.removeClass("comments-visible"); + } else { + $('#{0} .inline-comments'.format(boxid)).each(function(index){ + $(this).show(); + }) + button.addClass("comments-visible"); + } + }); })