File tree Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -163,6 +163,11 @@ input.search-input:focus {
163
163
padding : 10px ;
164
164
border-bottom : 0.1rem solid # e1e1e1 ;
165
165
cursor : pointer;
166
+ background : # fff ;
167
+ position : -webkit-sticky;
168
+ position : sticky;
169
+ top : 0px ;
170
+ z-index : 1 ;
166
171
}
167
172
168
173
.ghd-file-header .reveal-diff {
Original file line number Diff line number Diff line change @@ -50,6 +50,10 @@ fileHeaders.forEach(header => {
50
50
parent . querySelectorAll ( '.ghd-diff' ) . forEach ( diff => {
51
51
diff . classList . toggle ( 'hidden' )
52
52
} )
53
- header . classList . toggle ( 'collapsed' )
53
+ header . classList . toggle ( 'collapsed' ) && scrollIfNeeded ( header )
54
54
} )
55
55
} )
56
+
57
+ const scrollIfNeeded = elem => {
58
+ elem . getBoundingClientRect ( ) . top < 0 && elem . scrollIntoView ( true )
59
+ }
You can’t perform that action at this time.
0 commit comments