diff options
| author | Guillaume Gomez <guillaume1.gomez@gmail.com> | 2018-11-24 11:43:52 +0100 |
|---|---|---|
| committer | Guillaume Gomez <guillaume1.gomez@gmail.com> | 2018-11-24 11:43:52 +0100 |
| commit | 8d67de4e9165a643b74dae822be325a983beb10b (patch) | |
| tree | d535efdde4150a5ad7d9c0463a39a0005dc12740 /src/librustdoc/html/static/source-script.js | |
| parent | e87f8cc49b56ea2b8f01281a0b2baf20e12a319d (diff) | |
| download | rust-8d67de4e9165a643b74dae822be325a983beb10b.tar.gz rust-8d67de4e9165a643b74dae822be325a983beb10b.zip | |
Don't show file sidebar by default
Diffstat (limited to 'src/librustdoc/html/static/source-script.js')
| -rw-r--r-- | src/librustdoc/html/static/source-script.js | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/librustdoc/html/static/source-script.js b/src/librustdoc/html/static/source-script.js index f8e0cf196fb..1db8218dae6 100644 --- a/src/librustdoc/html/static/source-script.js +++ b/src/librustdoc/html/static/source-script.js @@ -82,12 +82,12 @@ function toggleSidebar() { sidebar.style.left = ""; this.style.left = ""; child.innerText = "<"; - updateLocalStorage("rustdoc-source-sidebar-hidden", "false"); + updateLocalStorage("rustdoc-source-sidebar-show", "true"); } else { sidebar.style.left = "-300px"; this.style.left = "0"; child.innerText = ">"; - updateLocalStorage("rustdoc-source-sidebar-hidden", "true"); + updateLocalStorage("rustdoc-source-sidebar-show", "false"); } } @@ -101,11 +101,11 @@ function createSidebarToggle() { var inner2 = document.createElement("div"); inner2.style.marginTop = "-2px"; - if (getCurrentValue("rustdoc-source-sidebar-hidden") === "true") { + if (getCurrentValue("rustdoc-source-sidebar-show") === "true") { + inner2.innerText = "<"; + } else { inner2.innerText = ">"; sidebarToggle.style.left = "0"; - } else { - inner2.innerText = "<"; } inner1.appendChild(inner2); @@ -124,7 +124,7 @@ function createSourceSidebar() { var sidebar = document.createElement("div"); sidebar.id = "source-sidebar"; - if (getCurrentValue("rustdoc-source-sidebar-hidden") === "true") { + if (getCurrentValue("rustdoc-source-sidebar-show") !== "true") { sidebar.style.left = "-300px"; } |
