1
Fork 0

Fix lint error, change scrape-examples.js minify call

This commit is contained in:
Will Crichton 2021-10-01 13:57:57 -07:00
parent 25323ec306
commit 55731bbc7d
3 changed files with 9 additions and 2 deletions

View file

@ -417,7 +417,7 @@ impl<'tcx> FormatRenderer<'tcx> for Context<'tcx> {
krate: krate.name.to_string(), krate: krate.name.to_string(),
css_file_extension: extension_css, css_file_extension: extension_css,
generate_search_filter, generate_search_filter,
scrape_examples_extension: call_locations.len() > 0, scrape_examples_extension: !call_locations.is_empty(),
}; };
let mut issue_tracker_base_url = None; let mut issue_tracker_base_url = None;
let mut include_sources = true; let mut include_sources = true;

View file

@ -304,7 +304,12 @@ pub(super) fn write_shared(
} }
if cx.shared.layout.scrape_examples_extension { if cx.shared.layout.scrape_examples_extension {
write_minify("scrape-examples.js", static_files::SCRAPE_EXAMPLES_JS, cx, options)?; cx.write_minify(
SharedResource::Unversioned { name: "scrape-examples.js" },
static_files::SCRAPE_EXAMPLES_JS,
options.enable_minification,
&options.emit,
)?;
} }
if let Some(ref css) = cx.shared.layout.css_file_extension { if let Some(ref css) = cx.shared.layout.css_file_extension {

View file

@ -1,3 +1,5 @@
/* global addClass, hasClass, removeClass, onEach */
(function () { (function () {
// Scroll code block to put the given code location in the middle of the viewer // Scroll code block to put the given code location in the middle of the viewer
function scrollToLoc(elt, loc) { function scrollToLoc(elt, loc) {