@@ -82,15 +82,15 @@ document.addEventListener("DOMContentLoaded", async() => {
82
82
let menus = document . querySelector ( "form>.pure-menu-list:not(.pure-menu-right)" ) ;
83
83
if ( ! menus ) return ;
84
84
85
- // Since this PR (https://github.com/rust-lang/docs.rs/pull/1527) merged,
85
+ // Since this PR (https://github.com/rust-lang/docs.rs/pull/1527) merged,
86
86
// the latest version path has changed:
87
87
// from https://docs.rs/tokio/1.14.0/tokio/ to https://docs.rs/tokio/latest/tokio/
88
88
//
89
89
// If we parse the crate version from url is 'latest',
90
90
// we should reparse it from the DOM to get the correct value.
91
91
if ( crateVersion === 'latest' ) {
92
- let versionText = document . querySelector ( '. nav-container a.crate-name>.title ' ) . textContent ;
93
- crateVersion = versionText . split ( '- ' ) [ 1 ] ;
92
+ let versionText = document . querySelector ( 'nav.sidebar .version ' ) . textContent ;
93
+ crateVersion = versionText . split ( ' ' ) [ 1 ] ;
94
94
}
95
95
96
96
// Exclude /crate/** pages
@@ -174,9 +174,9 @@ function insertAddToExtensionElement(state) {
174
174
let content , iconAttributes , iconFile ;
175
175
if ( state === "latest" ) {
176
176
content = `<p>
177
- You already added this crate (v${ installedVersion } ). Click again to remove it.
178
- Or click
179
- <span id="rse-here" style="text-decoration: underline; cursor: pointer">here</span>
177
+ You already added this crate (v${ installedVersion } ). Click again to remove it.
178
+ Or click
179
+ <span id="rse-here" style="text-decoration: underline; cursor: pointer">here</span>
180
180
to manage all your indexed crates.
181
181
</p>` ;
182
182
iconAttributes = `class="fa-svg fa-svg-fw" style="color:green"` ;
@@ -236,4 +236,4 @@ window.addEventListener("message", function(event) {
236
236
}
237
237
) ;
238
238
}
239
- } ) ;
239
+ } ) ;
0 commit comments