diff options
| author | Guillaume Gomez <guillaume.gomez@huawei.com> | 2022-04-25 16:53:59 +0200 |
|---|---|---|
| committer | Guillaume Gomez <guillaume.gomez@huawei.com> | 2022-04-26 20:59:33 +0200 |
| commit | 4e0be6ddeb7e05c5b9998f011175c22bca11d68e (patch) | |
| tree | 0f7643ee4d0812e2eb0c1ef4e937d569cb21afde /src | |
| parent | 509b145744ee0f441d9cba092831372c5029f716 (diff) | |
| download | rust-4e0be6ddeb7e05c5b9998f011175c22bca11d68e.tar.gz rust-4e0be6ddeb7e05c5b9998f011175c22bca11d68e.zip | |
Remove dead code in main.js
Diffstat (limited to 'src')
| -rw-r--r-- | src/librustdoc/html/static/js/main.js | 23 |
1 files changed, 0 insertions, 23 deletions
diff --git a/src/librustdoc/html/static/js/main.js b/src/librustdoc/html/static/js/main.js index cc9dc0adbca..9e5de9a843a 100644 --- a/src/librustdoc/html/static/js/main.js +++ b/src/librustdoc/html/static/js/main.js @@ -504,29 +504,6 @@ function hideThemeButtonState() { document.addEventListener("keypress", handleShortcut); document.addEventListener("keydown", handleShortcut); - (function() { - const x = document.getElementsByClassName("version-selector"); - if (x.length > 0) { - x[0].onchange = function() { - let url = document.location.href, stripped = ""; - const len = window.rootPath.match(/\.\.\//g).length + 1; - - for (let i = 0; i < len; ++i) { - const match = url.match(/\/[^/]*$/); - if (i < len - 1) { - stripped = match[0] + stripped; - } - url = url.substring(0, url.length - match[0].length); - } - - const selectedVersion = document.getElementsByClassName("version-selector")[0].value; - url += "/" + selectedVersion + stripped; - - document.location.href = url; - }; - } - }()); - // delayed sidebar rendering. window.initSidebarItems = function(items) { const sidebar = document.getElementsByClassName("sidebar-elems")[0]; |
