File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed
src/librustdoc/html/static Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -112,9 +112,11 @@ function defocusSearchBar() {
112
112
}
113
113
114
114
function getPageId ( ) {
115
- var id = document . location . href . split ( "#" ) [ 1 ] ;
116
- if ( id ) {
117
- return id . split ( "?" ) [ 0 ] . split ( "&" ) [ 0 ] ;
115
+ if ( window . location . hash ) {
116
+ var tmp = window . location . hash . replace ( / ^ # / , "" ) ;
117
+ if ( tmp . length > 0 ) {
118
+ return tmp ;
119
+ }
118
120
}
119
121
return null ;
120
122
}
@@ -2688,8 +2690,8 @@ function defocusSearchBar() {
2688
2690
2689
2691
autoCollapse ( pageId , getCurrentValue ( "rustdoc-collapse" ) === "true" ) ;
2690
2692
2691
- if ( window . location . hash && window . location . hash . length > 0 ) {
2692
- expandSection ( window . location . hash . replace ( / ^ # / , "" ) ) ;
2693
+ if ( pageId !== null ) {
2694
+ expandSection ( pageId ) ;
2693
2695
}
2694
2696
2695
2697
if ( main ) {
You can’t perform that action at this time.
0 commit comments