mirror of
https://github.com/huhu/rust-search-extension
synced 2024-11-14 15:47:12 +00:00
Fix source code navigate bug. Fix #212
This commit is contained in:
parent
75da853caa
commit
a4f1808aca
2 changed files with 3 additions and 2 deletions
|
@ -118,7 +118,7 @@ async function getFeatureFlagsMenuData() {
|
||||||
let optionalDependencies = parseOptionalDependencies(depsContent);
|
let optionalDependencies = parseOptionalDependencies(depsContent);
|
||||||
|
|
||||||
return { features, optionalDependencies };
|
return { features, optionalDependencies };
|
||||||
};
|
}
|
||||||
|
|
||||||
async function enhanceFeatureFlagsMenu(menu) {
|
async function enhanceFeatureFlagsMenu(menu) {
|
||||||
let crateData = JSON.parse(window.sessionStorage.getItem(`${rawCrateName}-${crateVersion}`));
|
let crateData = JSON.parse(window.sessionStorage.getItem(`${rawCrateName}-${crateVersion}`));
|
||||||
|
|
|
@ -9,7 +9,8 @@ document.addEventListener("DOMContentLoaded", () => {
|
||||||
// We fallback to the "srclink" of Option.
|
// We fallback to the "srclink" of Option.
|
||||||
let hash = currentUrl.hash.replace(/#(variant\.)?/i, "");
|
let hash = currentUrl.hash.replace(/#(variant\.)?/i, "");
|
||||||
let element = document.getElementById(hash)
|
let element = document.getElementById(hash)
|
||||||
|| document.querySelector(".fqn");
|
|| document.querySelector(".out-of-band");
|
||||||
|
|
||||||
if (element) {
|
if (element) {
|
||||||
let srclink = element.querySelector(".srclink");
|
let srclink = element.querySelector(".srclink");
|
||||||
location.href = srclink.href;
|
location.href = srclink.href;
|
||||||
|
|
Loading…
Reference in a new issue