From 4e0be6ddeb7e05c5b9998f011175c22bca11d68e Mon Sep 17 00:00:00 2001 From: Guillaume Gomez Date: Mon, 25 Apr 2022 16:53:59 +0200 Subject: [PATCH] Remove dead code in main.js --- src/librustdoc/html/static/js/main.js | 23 ----------------------- 1 file changed, 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];