Rollup merge of #75366 - GuillaumeGomez:help-button, r=jyn514

Add help button

Part of #75197.

Here is a screenshot of the result:

![Screenshot from 2020-08-10 16-53-20](https://user-images.githubusercontent.com/3050060/89796547-14112a00-db2a-11ea-9f25-57b30ab68f9b.png)

r? @jyn514
This commit is contained in:
Dylan DPC 2020-08-11 01:56:43 +02:00 committed by GitHub
commit 51ed33d8c2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 27 additions and 11 deletions

View File

@ -95,6 +95,7 @@ pub fn render<T: Print, S: Print>(
placeholder=\"Click or press S to search, ? for more options…\" \
type=\"search\">\
</div>\
<span class=\"help-button\">?</span>
<a id=\"settings-menu\" href=\"{root_path}settings.html\">\
<img src=\"{static_root_path}wheel{suffix}.svg\" \
width=\"18\" \

View File

@ -473,7 +473,9 @@ function defocusSearchBar() {
}());
document.addEventListener("click", function(ev) {
if (hasClass(ev.target, "collapse-toggle")) {
if (hasClass(ev.target, "help-button")) {
displayHelp(true, ev);
} else if (hasClass(ev.target, "collapse-toggle")) {
collapseDocs(ev.target, "toggle");
} else if (hasClass(ev.target.parentNode, "collapse-toggle")) {
collapseDocs(ev.target.parentNode, "toggle");

View File

@ -674,7 +674,7 @@ a {
}
.search-container > div {
display: inline-flex;
width: calc(100% - 34px);
width: calc(100% - 63px);
}
#crate-search {
margin-top: 5px;
@ -1250,14 +1250,24 @@ h4 > .notable-traits {
outline: none;
}
#settings-menu {
#settings-menu, .help-button {
position: absolute;
right: 0;
top: 10px;
}
#settings-menu {
right: 0;
outline: none;
}
#theme-picker, #settings-menu {
.help-button {
right: 30px;
font-family: "Fira Sans",sans-serif;
text-align: center;
font-size: 17px;
}
#theme-picker, #settings-menu, .help-button {
padding: 4px;
width: 27px;
height: 29px;

View File

@ -492,7 +492,7 @@ kbd {
box-shadow-color: #c6cbd1;
}
#theme-picker, #settings-menu {
#theme-picker, #settings-menu, .help-button {
border-color: #5c6773;
background-color: #0f1419;
}
@ -502,7 +502,8 @@ kbd {
}
#theme-picker:hover, #theme-picker:focus,
#settings-menu:hover, #settings-menu:focus {
#settings-menu:hover, #settings-menu:focus,
.help-button:hover, .help-button:focus {
border-color: #e0e0e0;
}

View File

@ -386,13 +386,14 @@ kbd {
box-shadow-color: #c6cbd1;
}
#theme-picker, #settings-menu {
#theme-picker, #settings-menu, .help-button {
border-color: #e0e0e0;
background: #f0f0f0;
}
#theme-picker:hover, #theme-picker:focus,
#settings-menu:hover, #settings-menu:focus {
#settings-menu:hover, #settings-menu:focus,
.help-button:hover, .help-button:focus {
border-color: #ffb900;
}

View File

@ -377,13 +377,14 @@ kbd {
box-shadow-color: #c6cbd1;
}
#theme-picker, #settings-menu {
#theme-picker, #settings-menu, .help-button {
border-color: #e0e0e0;
background-color: #fff;
}
#theme-picker:hover, #theme-picker:focus,
#settings-menu:hover, #settings-menu:focus {
#settings-menu:hover, #settings-menu:focus,
.help-button:hover, .help-button:focus {
border-color: #717171;
}