Skip to content

Commit

Permalink
Auto merge of #56876 - GuillaumeGomez:fix-JS-errors, r=QuietMisdreavus
Browse files Browse the repository at this point in the history
Fix js errors

Fix JS error (you can see it on the iterator doc page) and the invalid theme switch.

r? @QuietMisdreavus
  • Loading branch information
bors committed Dec 16, 2018
2 parents 748d354 + fa9c823 commit 19dc2ca
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions src/librustdoc/html/render.rs
Original file line number Diff line number Diff line change
Expand Up @@ -868,10 +868,10 @@ themePicker.onblur = handleThemeButtonsBlur;
}

{
let mut data = static_files::STORAGE_JS.to_owned();
data.push_str(&format!("var resourcesSuffix = \"{}\";", cx.shared.resource_suffix));
write_minify(cx.dst.join(&format!("storage{}.js", cx.shared.resource_suffix)),
&data,
&format!("var resourcesSuffix = \"{}\";{}",
cx.shared.resource_suffix,
static_files::STORAGE_JS),
options.enable_minification)?;
}

Expand Down
4 changes: 2 additions & 2 deletions src/librustdoc/html/static/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -213,9 +213,9 @@ if (!DOMTokenList.prototype.remove) {
function expandSection(id) {
var elem = document.getElementById(id);
if (elem && isHidden(elem)) {
var h3 = elem.parentNode.previousSibling;
var h3 = elem.parentNode.previousElementSibling;
if (h3 && h3.tagName !== "H3") {
h3 = h3.previousSibling; // skip div.docblock
h3 = h3.previousElementSibling; // skip div.docblock
}

if (h3) {
Expand Down
2 changes: 1 addition & 1 deletion src/librustdoc/html/static/storage.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ function switchTheme(styleElem, mainStyleElem, newTheme) {

var found = false;
if (savedHref.length === 0) {
onEach(document.getElementsByTagName("link"), function(el) {
onEachLazy(document.getElementsByTagName("link"), function(el) {
savedHref.push(el.href);
});
}
Expand Down

0 comments on commit 19dc2ca

Please sign in to comment.