File tree 3 files changed +12
-2
lines changed 3 files changed +12
-2
lines changed Original file line number Diff line number Diff line change 1862
1862
.diff-file-box {
1863
1863
border : 1px solid transparent;
1864
1864
border-radius : var (--border-radius );
1865
+ scroll-margin-top : 47px ; /* match .repository .diff-detail-box */
1866
+ }
1867
+
1868
+ @media (max-width : 991px ) {
1869
+ .diff-file-box {
1870
+ scroll-margin-top : 77px ; /* match .repository .diff-detail-box */
1871
+ }
1865
1872
}
1866
1873
1867
1874
/* TODO: this can potentially be made "global" by removing the class prefix */
Original file line number Diff line number Diff line change @@ -242,12 +242,12 @@ a.blob-excerpt:hover {
242
242
display : none;
243
243
}
244
244
245
- .pull .files .diff [ id ] {
245
+ .pull .files .diff . comment {
246
246
scroll-margin-top : 99px ;
247
247
}
248
248
249
249
@media (max-width : 991px ) {
250
- .pull .files .diff [ id ] {
250
+ .pull .files .diff . comment {
251
251
scroll-margin-top : 130px ;
252
252
}
253
253
}
Original file line number Diff line number Diff line change @@ -8,6 +8,9 @@ import {svg} from '../svg.js';
8
8
export function setFileFolding ( fileContentBox , foldArrow , newFold ) {
9
9
foldArrow . innerHTML = svg ( `octicon-chevron-${ newFold ? 'right' : 'down' } ` , 18 ) ;
10
10
fileContentBox . setAttribute ( 'data-folded' , newFold ) ;
11
+ if ( newFold && fileContentBox . getBoundingClientRect ( ) . top < 0 ) {
12
+ fileContentBox . scrollIntoView ( ) ;
13
+ }
11
14
}
12
15
13
16
// Like `setFileFolding`, except that it automatically inverts the current file folding state.
You can’t perform that action at this time.
0 commit comments