Fixes run button appearing when it shouldn't

This commit is contained in:
Guillaume Gomez 2016-09-21 23:43:03 +02:00
parent 5cc6c6b1b7
commit 8983d1e67a
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;
}