Fixes run button appearing when it shouldn't
This commit is contained in:
parent
5cc6c6b1b7
commit
8983d1e67a
@ -176,10 +176,10 @@ r##"<!DOCTYPE html>
|
||||
krate = layout.krate,
|
||||
play_url = layout.playground_url,
|
||||
play_js = if layout.playground_url.is_empty() {
|
||||
"".to_string()
|
||||
format!(r#"<script src="{}extra.js"></script>"#, page.root_path)
|
||||
} else {
|
||||
format!(r#"<script src="{}playpen.js"></script>"#, page.root_path)
|
||||
},
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
|
25
src/librustdoc/html/static/extra.js
Normal file
25
src/librustdoc/html/static/extra.js
Normal file
@ -0,0 +1,25 @@
|
||||
// Copyright 2014-2016 The Rust Project Developers. See the COPYRIGHT
|
||||
// file at the top-level directory of this distribution and at
|
||||
// http://rust-lang.org/COPYRIGHT.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
||||
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
||||
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
||||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
/*jslint browser: true, es5: true */
|
||||
/*globals $: true, rootPath: true */
|
||||
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
'use strict';
|
||||
|
||||
if (!window.playgroundUrl) {
|
||||
var runButtons = document.querySelectorAll(".test-arrow");
|
||||
|
||||
for (var i = 0; i < runButtons.length; i++) {
|
||||
runButtons[i].classList.remove("test-arrow");
|
||||
}
|
||||
return;
|
||||
}
|
||||
});
|
@ -15,6 +15,11 @@ document.addEventListener('DOMContentLoaded', function() {
|
||||
'use strict';
|
||||
|
||||
if (!window.playgroundUrl) {
|
||||
var runButtons = document.querySelectorAll(".test-arrow");
|
||||
|
||||
for (var i = 0; i < runButtons.length; i++) {
|
||||
runButtons[i].classList.remove("test-arrow");
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user