Rollup merge of #55858 - GuillaumeGomez:fixes-rustdoc-codeblocks, r=QuietMisdreavus

Small fixes on code blocks in rustdoc

It currently has a little margin issue with the `i` and there were js errors.

r? @QuietMisdreavus
This commit is contained in:
kennytm 2018-11-13 13:03:14 +08:00
commit 828dd17a91
No known key found for this signature in database
GPG Key ID: FEF6C8051D0E013C
2 changed files with 9 additions and 4 deletions

View File

@ -2262,17 +2262,17 @@
onEach(document.getElementsByClassName('rust-example-rendered'), function(e) {
if (hasClass(e, 'compile_fail')) {
e.addEventListener("mouseover", function(event) {
e.previousElementSibling.childNodes[0].style.color = '#f00';
this.parentElement.previousElementSibling.childNodes[0].style.color = '#f00';
});
e.addEventListener("mouseout", function(event) {
e.previousElementSibling.childNodes[0].style.color = '';
this.parentElement.previousElementSibling.childNodes[0].style.color = '';
});
} else if (hasClass(e, 'ignore')) {
e.addEventListener("mouseover", function(event) {
e.previousElementSibling.childNodes[0].style.color = '#ff9200';
this.parentElement.previousElementSibling.childNodes[0].style.color = '#ff9200';
});
e.addEventListener("mouseout", function(event) {
e.previousElementSibling.childNodes[0].style.color = '';
this.parentElement.previousElementSibling.childNodes[0].style.color = '';
});
}
lineNumbersFunc(e);

View File

@ -284,6 +284,7 @@ nav.sub {
body:not(.source) .example-wrap {
display: inline-flex;
margin-bottom: 10px;
}
.example-wrap {
@ -303,6 +304,10 @@ body:not(.source) .example-wrap > pre.rust {
width: 100%;
}
body:not(.source) .example-wrap > pre {
margin: 0;
}
#search {
margin-left: 230px;
position: relative;