about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMazdak Farrokhzad <twingoow@gmail.com>2019-01-18 18:06:33 +0100
committerGitHub <noreply@github.com>2019-01-18 18:06:33 +0100
commite26498026f3f8002c77a14ccb228ac4d26d1cbd7 (patch)
treec5359319988e86375ae8f6642a98611d2a825a1e
parent4091ca01832411fdfcefa9fe4be958abfcc5a985 (diff)
parented717f30ec3006e465ed4d68adf31cabdf0329fa (diff)
Rollup merge of #57636 - GuillaumeGomez:fix-sources-sidebar, r=QuietMisdreavus
Fix sources sidebar not showing up

Fixes #57601.

The order of imports made it so that the sidebar creation was called before the sidebar sources were created. Like this, when the sources are loaded, they create the sidebar as expected.

r? @QuietMisdreavus
-rw-r--r--src/librustdoc/html/render.rs2
-rw-r--r--src/librustdoc/html/static/source-script.js2
2 files changed, 1 insertions, 3 deletions
diff --git a/src/librustdoc/html/render.rs b/src/librustdoc/html/render.rs
index 3a64c56fc8e..06846d4ed0c 100644
--- a/src/librustdoc/html/render.rs
+++ b/src/librustdoc/html/render.rs
@@ -1076,7 +1076,7 @@ themePicker.onblur = handleThemeButtonsBlur;
         all_sources.sort();
         let mut w = try_err!(File::create(&dst), &dst);
         try_err!(writeln!(&mut w,
-                          "var N = null;var sourcesIndex = {{}};\n{}",
+                          "var N = null;var sourcesIndex = {{}};\n{}\ncreateSourceSidebar();",
                           all_sources.join("\n")),
                  &dst);
     }
diff --git a/src/librustdoc/html/static/source-script.js b/src/librustdoc/html/static/source-script.js
index 0affe1c6812..c5d6fa16f55 100644
--- a/src/librustdoc/html/static/source-script.js
+++ b/src/librustdoc/html/static/source-script.js
@@ -137,5 +137,3 @@ function createSourceSidebar() {
 
     main.insertBefore(sidebar, main.firstChild);
 }
-
-createSourceSidebar();