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 1867
1867
.diff-file-box {
1868
1868
border : 1px solid transparent;
1869
1869
border-radius : var (--border-radius );
1870
+ scroll-margin-top : 47px ; /* match .repository .diff-detail-box */
1871
+ }
1872
+
1873
+ @media (max-width : 991px ) {
1874
+ .diff-file-box {
1875
+ scroll-margin-top : 77px ; /* match .repository .diff-detail-box */
1876
+ }
1870
1877
}
1871
1878
1872
1879
/* TODO: this can potentially be made "global" by removing the class prefix */
Original file line number Diff line number Diff line change @@ -246,12 +246,12 @@ a.blob-excerpt:hover {
246
246
display : none;
247
247
}
248
248
249
- .pull .files .diff [ id ] {
249
+ .pull .files .diff . comment {
250
250
scroll-margin-top : 99px ;
251
251
}
252
252
253
253
@media (max-width : 991px ) {
254
- .pull .files .diff [ id ] {
254
+ .pull .files .diff . comment {
255
255
scroll-margin-top : 130px ;
256
256
}
257
257
}
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