# HG changeset patch # User lisaq # Date 2016-07-29 14:20:48 # Node ID bf98000c261f74ebb58739c0576da0aad5cb3b88 # Parent f6a718776dd4b065337eb354b527125214ff5b2d pull requests: add show/hide comment functionality #4106 diff --git a/rhodecode/templates/pullrequests/pullrequest_show.html b/rhodecode/templates/pullrequests/pullrequest_show.html --- 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"); + } + }); })