Skip to content

Commit b1c1e15

Browse files
6543zeripath
authored andcommitted
Ensure that diff stats can scroll independently of the diff (#8581)
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 b539a6e commit b1c1e15

File tree

3 files changed

+205
-190
lines changed

3 files changed

+205
-190
lines changed

public/css/index.css

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -667,8 +667,6 @@ i.icon.centerlock{top:1.5em}
667667
.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}
668668
.repository .diff-detail-box{padding:7px 0;background:#fff;line-height:30px}
669669
.repository .diff-detail-box>div:after{clear:both;content:"";display:block}
670-
.repository .diff-detail-box ol{clear:both;padding-left:0;margin-top:5px;margin-bottom:28px}
671-
.repository .diff-detail-box ol li{list-style:none;padding-bottom:4px;margin-bottom:4px;border-bottom:1px dashed #ddd;padding-left:6px}
672670
.repository .diff-detail-box span.status{display:inline-block;width:12px;height:12px;margin-right:8px;vertical-align:middle}
673671
.repository .diff-detail-box span.status.modify{background-color:#f0db88}
674672
.repository .diff-detail-box span.status.add{background-color:#b4e2b4}
@@ -705,6 +703,11 @@ i.icon.centerlock{top:1.5em}
705703
.repository .diff-file-box.file-content{clear:right}
706704
.repository .diff-file-box.file-content img{max-width:100%;padding:5px 5px 0 5px}
707705
.repository .diff-file-box.file-content img.emoji{padding:0}
706+
.repository .diff-stats{clear:both;margin-bottom:5px;max-height:400px;overflow:auto;padding-left:0}
707+
.repository .diff-stats li{list-style:none;padding-bottom:4px;margin-bottom:4px;border-bottom:1px dashed #ddd;padding-left:6px}
708+
.repository .diff-stats .diff-counter{margin-right:15px}
709+
.repository .diff-stats .diff-counter .del{color:red}
710+
.repository .diff-stats .diff-counter .add{color:green}
708711
.repository .repo-search-result{padding-top:10px;padding-bottom:10px}
709712
.repository .repo-search-result .lines-num a{color:inherit}
710713
.repository.quickstart .guide .item{padding:1em}

public/less/_repository.less

Lines changed: 28 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1246,21 +1246,6 @@
12461246
display: block;
12471247
}
12481248

1249-
ol {
1250-
clear: both;
1251-
padding-left: 0;
1252-
margin-top: 5px;
1253-
margin-bottom: 28px;
1254-
1255-
li {
1256-
list-style: none;
1257-
padding-bottom: 4px;
1258-
margin-bottom: 4px;
1259-
border-bottom: 1px dashed #dddddd;
1260-
padding-left: 6px;
1261-
}
1262-
}
1263-
12641249
span.status {
12651250
display: inline-block;
12661251
width: 12px;
@@ -1475,6 +1460,34 @@
14751460
}
14761461
}
14771462

1463+
.diff-stats {
1464+
1465+
clear: both;
1466+
margin-bottom: 5px;
1467+
max-height: 400px;
1468+
overflow: auto;
1469+
padding-left: 0;
1470+
1471+
li {
1472+
list-style: none;
1473+
padding-bottom: 4px;
1474+
margin-bottom: 4px;
1475+
border-bottom: 1px dashed #dddddd;
1476+
padding-left: 6px;
1477+
}
1478+
1479+
.diff-counter {
1480+
margin-right: 15px;
1481+
1482+
.del {
1483+
color: red;
1484+
}
1485+
.add {
1486+
color: green;
1487+
}
1488+
}
1489+
}
1490+
14781491
.repo-search-result {
14791492
padding-top: 10px;
14801493
padding-bottom: 10px;

0 commit comments

Comments
 (0)