X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=src%2Flibrustdoc%2Fhtml%2Fstatic%2Fmain.js;h=ff28c4f40bcae15ffec1015cf7d2d5a7f95142d1;hb=9a3e22e32f634014b02f13495aef3f0e8cdbb1b7;hp=877ac9a62bbec67bd62275bd7b9d13709c4a199e;hpb=d9f97809187e4830ceedc00ed32467c252ff48f2;p=rust.git diff --git a/src/librustdoc/html/static/main.js b/src/librustdoc/html/static/main.js index 877ac9a62bb..ff28c4f40bc 100644 --- a/src/librustdoc/html/static/main.js +++ b/src/librustdoc/html/static/main.js @@ -68,7 +68,8 @@ if (!DOMTokenList.prototype.remove) { "keyword", "existential", "attr", - "derive"]; + "derive", + "traitalias"]; var search_input = document.getElementsByClassName("search-input")[0]; @@ -79,8 +80,6 @@ if (!DOMTokenList.prototype.remove) { // 2 for "In Return Types" var currentTab = 0; - var themesWidth = null; - var titleBeforeSearch = document.title; function getPageId() { @@ -240,7 +239,7 @@ if (!DOMTokenList.prototype.remove) { return String.fromCharCode(c); } - function displayHelp(display, ev) { + function displayHelp(display, ev, help) { if (display === true) { if (hasClass(help, "hidden")) { ev.preventDefault(); @@ -258,7 +257,7 @@ if (!DOMTokenList.prototype.remove) { hideModal(); var search = document.getElementById("search"); if (hasClass(help, "hidden") === false) { - displayHelp(false, ev); + displayHelp(false, ev, help); } else if (hasClass(search, "hidden") === false) { ev.preventDefault(); addClass(search, "hidden"); @@ -289,7 +288,7 @@ if (!DOMTokenList.prototype.remove) { case "s": case "S": - displayHelp(false, ev); + displayHelp(false, ev, help); hideModal(); ev.preventDefault(); focusSearchBar(); @@ -304,7 +303,7 @@ if (!DOMTokenList.prototype.remove) { case "?": if (ev.shiftKey) { hideModal(); - displayHelp(true, ev); + displayHelp(true, ev, help); } break; } @@ -654,7 +653,7 @@ if (!DOMTokenList.prototype.remove) { return MAX_LEV_DISTANCE + 1; } } - return lev_distance;//Math.ceil(total / done); + return Math.ceil(total / done); } } return MAX_LEV_DISTANCE + 1; @@ -1598,7 +1597,7 @@ if (!DOMTokenList.prototype.remove) { clearTimeout(searchTimeout); if (search_input.value.length === 0) { if (browserSupportsHistoryApi()) { - history.replaceState("", "std - Rust", "?search="); + history.replaceState("", window.currentCrate + " - Rust", "?search="); } if (hasClass(main, "content")) { removeClass(main, "hidden"); @@ -1786,6 +1785,7 @@ if (!DOMTokenList.prototype.remove) { block("type", "Type Definitions"); block("foreigntype", "Foreign Types"); block("keyword", "Keywords"); + block("traitalias", "Trait Aliases"); } window.initSidebarItems = initSidebarItems; @@ -2432,7 +2432,7 @@ if (!DOMTokenList.prototype.remove) { // for vertical layout (column-oriented flex layout for divs caused // errors in mobile browsers). if (e.tagName === "H2" || e.tagName === "H3") { - let nextTagName = e.nextElementSibling.tagName; + var nextTagName = e.nextElementSibling.tagName; if (nextTagName == "H2" || nextTagName == "H3") { e.nextElementSibling.style.display = "flex"; } else {