diff --git a/src/main/twirl/helper/diff.scala.html b/src/main/twirl/helper/diff.scala.html
index 1f3bbef..3554cb6 100644
--- a/src/main/twirl/helper/diff.scala.html
+++ b/src/main/twirl/helper/diff.scala.html
@@ -49,6 +49,7 @@
@diff.oldPath -> @diff.newPath
@if(newCommitId.isDefined){
}
@@ -61,6 +62,7 @@
} @diff.newPath
@if(newCommitId.isDefined){
}
@@ -69,6 +71,7 @@
@diff.oldPath
@if(oldCommitId.isDefined){
}
@@ -162,6 +165,12 @@
}).parent().nextAll(':not(.not-diff):first').before(tmp);
}
});
+ $('.toggle-notes').change(function() {
+ if (!$(this).prop('checked')) {
+ $(this).closest('table').find('.not-diff.inline-comment-form').remove();
+ }
+ $(this).closest('table').find('.not-diff').toggle();
+ });
@if(hasWritePermission) {
$('table.diff th').hover(
function() {
@@ -181,7 +190,11 @@
);
$('.add-comment').click(function() {
var $this = $(this),
- $tr = $this.closest('tr');
+ $tr = $this.closest('tr'),
+ $check = $this.closest('table:not(.diff)').find('.toggle-notes');
+ if (!$check.prop('checked')) {
+ $check.prop('checked', true).trigger('change');
+ }
if (!$tr.nextAll(':not(.not-diff):first').prev().hasClass('inline-comment-form')) {
var commitId = $this.closest('.table-bordered').attr('commitId'),
fileName = $this.closest('.table-bordered').attr('fileName'),