Auto merge of #36637 - GuillaumeGomez:fix_run_button, r=bluss

Fixes run button appearing when it shouldn't

Fixes #36621.

r? @steveklabnik
This commit is contained in:
bors 2016-10-08 19:42:55 -07:00 committed by GitHub
commit b98cc352cb
3 changed files with 32 additions and 2 deletions

View File

@ -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)
},
}
)
}

View 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;
}
});

View File

@ -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;
}