File tree 2 files changed +8
-2
lines changed
src/librustdoc/html/static/js
2 files changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -370,8 +370,12 @@ function preLoadCss(cssUrl) {
370
370
item => {
371
371
const numbered = / ( [ ^ - ] + ) - ( [ 0 - 9 ] + ) / . exec ( item . id ) ;
372
372
if ( item . id === assocId || ( numbered && numbered [ 1 ] === assocId ) ) {
373
- expandSection ( item . id ) ;
374
- window . location = "#" + item . id ;
373
+ openParentDetails ( item ) ;
374
+ item . scrollIntoView ( ) ;
375
+ // Let the section expand itself before trying to highlight
376
+ setTimeout ( ( ) => {
377
+ window . location . replace ( "#" + item . id ) ;
378
+ } , 0 ) ;
375
379
}
376
380
}
377
381
) ;
Original file line number Diff line number Diff line change @@ -20,6 +20,7 @@ wait-for: "#impl-ZyxwvutMethodDisambiguation"
20
20
assert-document-property: ({
21
21
"URL": "struct.ZyxwvutMethodDisambiguation.html#method.method_impl_disambiguation"
22
22
}, ENDS_WITH)
23
+ assert: "section:target"
23
24
24
25
goto: "file://" + |DOC_PATH| + "/test_docs/index.html"
25
26
@@ -39,3 +40,4 @@ wait-for: "#impl-ZyxwvutMethodDisambiguation"
39
40
assert-document-property: ({
40
41
"URL": "struct.ZyxwvutMethodDisambiguation.html#method.method_impl_disambiguation-1"
41
42
}, ENDS_WITH)
43
+ assert: "section:target"
You can’t perform that action at this time.
0 commit comments