Skip to content

Commit cf35355

Browse files
6543lunny
authored andcommitted
Ensure that diff stats can scroll independently of the diff (#8581) (#8611)
This PR ensures that once opened the diff stats detail box can be scrolled independently of the diff on the compare page. Fixes #5532 Details: * make diff-detail-box the main container * move file diff at the same level as diff-stats * make diff-view options sticy again * make diff-stats scroll if to mouch * rm useless css info * less: mv diff-stats to own class * use new css class * cleanup less file * diff-counter: margin-right: 15px; * make CI work * make numbers colorful * add sign (-/+) to numbers
1 parent 8e9265c commit cf35355

File tree

3 files changed

+205
-190
lines changed

3 files changed

+205
-190
lines changed

public/css/index.css

+5-2
Original file line numberDiff line numberDiff line change
@@ -659,8 +659,6 @@ footer .ui.left,footer .ui.right{line-height:40px}
659659
.repository #commits-table td.sha .sha.label.isSigned.isVerified:hover,.repository #repo-files-table .sha.label.isSigned.isVerified:hover{background:rgba(33,186,69,.3)!important}
660660
.repository .diff-detail-box{padding:7px 0;background:#fff;line-height:30px}
661661
.repository .diff-detail-box>div:after{clear:both;content:"";display:block}
662-
.repository .diff-detail-box ol{clear:both;padding-left:0;margin-top:5px;margin-bottom:28px}
663-
.repository .diff-detail-box ol li{list-style:none;padding-bottom:4px;margin-bottom:4px;border-bottom:1px dashed #ddd;padding-left:6px}
664662
.repository .diff-detail-box span.status{display:inline-block;width:12px;height:12px;margin-right:8px;vertical-align:middle}
665663
.repository .diff-detail-box span.status.modify{background-color:#f0db88}
666664
.repository .diff-detail-box span.status.add{background-color:#b4e2b4}
@@ -697,6 +695,11 @@ footer .ui.left,footer .ui.right{line-height:40px}
697695
.repository .diff-file-box.file-content{clear:right}
698696
.repository .diff-file-box.file-content img{max-width:100%;padding:5px 5px 0 5px}
699697
.repository .diff-file-box.file-content img.emoji{padding:0}
698+
.repository .diff-stats{clear:both;margin-bottom:5px;max-height:400px;overflow:auto;padding-left:0}
699+
.repository .diff-stats li{list-style:none;padding-bottom:4px;margin-bottom:4px;border-bottom:1px dashed #ddd;padding-left:6px}
700+
.repository .diff-stats .diff-counter{margin-right:15px}
701+
.repository .diff-stats .diff-counter .del{color:red}
702+
.repository .diff-stats .diff-counter .add{color:green}
700703
.repository .repo-search-result{padding-top:10px;padding-bottom:10px}
701704
.repository .repo-search-result .lines-num a{color:inherit}
702705
.repository.quickstart .guide .item{padding:1em}

public/less/_repository.less

+28-15
Original file line numberDiff line numberDiff line change
@@ -1237,21 +1237,6 @@
12371237
display: block;
12381238
}
12391239

1240-
ol {
1241-
clear: both;
1242-
padding-left: 0;
1243-
margin-top: 5px;
1244-
margin-bottom: 28px;
1245-
1246-
li {
1247-
list-style: none;
1248-
padding-bottom: 4px;
1249-
margin-bottom: 4px;
1250-
border-bottom: 1px dashed #dddddd;
1251-
padding-left: 6px;
1252-
}
1253-
}
1254-
12551240
span.status {
12561241
display: inline-block;
12571242
width: 12px;
@@ -1466,6 +1451,34 @@
14661451
}
14671452
}
14681453

1454+
.diff-stats {
1455+
1456+
clear: both;
1457+
margin-bottom: 5px;
1458+
max-height: 400px;
1459+
overflow: auto;
1460+
padding-left: 0;
1461+
1462+
li {
1463+
list-style: none;
1464+
padding-bottom: 4px;
1465+
margin-bottom: 4px;
1466+
border-bottom: 1px dashed #dddddd;
1467+
padding-left: 6px;
1468+
}
1469+
1470+
.diff-counter {
1471+
margin-right: 15px;
1472+
1473+
.del {
1474+
color: red;
1475+
}
1476+
.add {
1477+
color: green;
1478+
}
1479+
}
1480+
}
1481+
14691482
.repo-search-result {
14701483
padding-top: 10px;
14711484
padding-bottom: 10px;

0 commit comments

Comments
 (0)