Skip to content

Commit 7f7e7f3

Browse files
Fix 'add code comment' button being invisible all the time (#13389)
* Fix 'add code comment' button being invisible all the time * Fix off-center icon * Remove old JS hover hack * Show on full-line hover Co-authored-by: techknowlogick <[email protected]>
1 parent 06268dc commit 7f7e7f3

File tree

2 files changed

+5
-16
lines changed

2 files changed

+5
-16
lines changed

web_src/js/index.js

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1238,16 +1238,6 @@ function initPullRequestReview() {
12381238
$(this).closest('.menu').toggle('visible');
12391239
});
12401240

1241-
$('.code-view .lines-code,.code-view .lines-num')
1242-
.on('mouseenter', function () {
1243-
const parent = $(this).closest('td');
1244-
$(this).closest('tr').addClass(
1245-
parent.hasClass('lines-num-old') || parent.hasClass('lines-code-old') ? 'focus-lines-old' : 'focus-lines-new'
1246-
);
1247-
})
1248-
.on('mouseleave', function () {
1249-
$(this).closest('tr').removeClass('focus-lines-new focus-lines-old');
1250-
});
12511241
$('.add-code-comment').on('click', function (e) {
12521242
if ($(e.target).hasClass('btn-add-single')) return; // https://github.com/go-gitea/gitea/issues/4745
12531243
e.preventDefault();

web_src/less/_review.less

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
.ui.button.add-code-comment {
22
font-size: 14px;
33
height: 16px;
4-
line-height: 16px !important;
4+
line-height: 12px !important;
55
padding: 0;
66
position: relative;
77
width: 16px;
@@ -17,6 +17,10 @@
1717
}
1818
}
1919

20+
.diff-file-box .lines-code:hover .ui.button.add-code-comment {
21+
opacity: 1;
22+
}
23+
2024
.repository .diff-file-box .code-diff .add-comment-left,
2125
.repository .diff-file-box .code-diff .add-comment-right,
2226
.repository .diff-file-box .code-diff .add-code-comment .add-comment-left,
@@ -40,11 +44,6 @@
4044
}
4145
}
4246

43-
.focus-lines-new .ui.button.add-code-comment.add-code-comment-right,
44-
.focus-lines-old .ui.button.add-code-comment.add-code-comment-left {
45-
opacity: 1;
46-
}
47-
4847
.comment-code-cloud {
4948
padding: 4px;
5049
padding-left: 0;

0 commit comments

Comments
 (0)