diff --git a/src/librustdoc/html/static/js/main.js b/src/librustdoc/html/static/js/main.js index a9eee808b05a..4698375f6ccb 100644 --- a/src/librustdoc/html/static/js/main.js +++ b/src/librustdoc/html/static/js/main.js @@ -1811,7 +1811,7 @@ href="https://doc.rust-lang.org/${channel}/rustdoc/read-documentation/search.htm // from settings.js, which uses a separate function. It's done here because // the minimum sidebar size is rather uncomfortable, and it must pass // through that size when using the shrink-to-nothing gesture. - const hideSidebar = function hideSidebar() { + const hideSidebar = function() { if (isSrcPage) { window.rustdocCloseSourceSidebar(); updateLocalStorage("src-sidebar-width", null); @@ -1844,7 +1844,7 @@ href="https://doc.rust-lang.org/${channel}/rustdoc/read-documentation/search.htm // the visible range without releasing it. You can, however, grab the // resize handle on a source page with the sidebar closed, because it // remains visible all the time on there. - const showSidebar = function showSidebar() { + const showSidebar = function() { if (isSrcPage) { window.rustdocShowSourceSidebar(); } else { @@ -1859,7 +1859,7 @@ href="https://doc.rust-lang.org/${channel}/rustdoc/read-documentation/search.htm * * @param {number} size - CSS px width of the sidebar. */ - const changeSidebarSize = function changeSidebarSize(size) { + const changeSidebarSize = function(size) { if (isSrcPage) { updateLocalStorage("src-sidebar-width", size.toString()); // [RUSTDOCIMPL] CSS variable fast path @@ -1879,11 +1879,11 @@ href="https://doc.rust-lang.org/${channel}/rustdoc/read-documentation/search.htm // Check if the sidebar is hidden. Since src pages and doc pages have // different settings, this function has to check that. - function isSidebarHidden() { + const isSidebarHidden = function() { return isSrcPage ? !hasClass(document.documentElement, "src-sidebar-expanded") : hasClass(document.documentElement, "hide-sidebar"); - } + }; /** * Respond to the resize handle event. @@ -1892,7 +1892,7 @@ href="https://doc.rust-lang.org/${channel}/rustdoc/read-documentation/search.htm * * @param {PointerEvent} e */ - function resize(e) { + const resize = function(e) { if (currentPointerId === null || currentPointerId !== e.pointerId) { return; } @@ -1923,7 +1923,7 @@ href="https://doc.rust-lang.org/${channel}/rustdoc/read-documentation/search.htm ); }, 100); } - } + }; // Respond to the window resize event. window.addEventListener("resize", () => { if (window.innerWidth < RUSTDOC_MOBILE_BREAKPOINT) { @@ -1940,7 +1940,7 @@ href="https://doc.rust-lang.org/${channel}/rustdoc/read-documentation/search.htm /** * @param {PointerEvent=} e */ - const stopResize = function stopResize(e) { + const stopResize = function(e) { if (currentPointerId === null) { return; } @@ -1962,7 +1962,7 @@ href="https://doc.rust-lang.org/${channel}/rustdoc/read-documentation/search.htm /** * @param {PointerEvent} e */ - const initResize = function initResize(e) { + const initResize = function(e) { if (currentPointerId !== null || e.altKey || e.ctrlKey || e.metaKey || e.button !== 0) { return; }