Make the help visible in all the themes of mdbook
Also handle the ? key with or without shift being pressed.
This commit is contained in:
parent
4573f4d882
commit
2b455fcd34
2 changed files with 16 additions and 7 deletions
|
|
@ -288,6 +288,7 @@ sup {
|
|||
right: 0;
|
||||
bottom: 0;
|
||||
background-color: rgba(225,225,225,1);
|
||||
color: black;
|
||||
z-index: 2;
|
||||
cursor: pointer;
|
||||
border-width: 3px;
|
||||
|
|
@ -297,6 +298,12 @@ sup {
|
|||
|
||||
padding: 10px;
|
||||
}
|
||||
#help-overlay kbd {
|
||||
border-width: 1px;
|
||||
border-color: black;
|
||||
border-style: solid;
|
||||
background-color: white;
|
||||
}
|
||||
#help-title {
|
||||
text-align: center;
|
||||
}
|
||||
|
|
@ -668,14 +668,16 @@ aria-label="Show hidden lines"></button>';
|
|||
document.getElementById("help-overlay").style.display = "none";
|
||||
}
|
||||
|
||||
if (e.shiftKey) {
|
||||
switch (e.key) {
|
||||
case '?':
|
||||
e.preventDefault();
|
||||
showHelp();
|
||||
break;
|
||||
}
|
||||
// Usually needs the Shift key to be pressed
|
||||
switch (e.key) {
|
||||
case '?':
|
||||
e.preventDefault();
|
||||
showHelp();
|
||||
break;
|
||||
}
|
||||
|
||||
// Rest of the keys are only active when the Shift key is not pressed
|
||||
if (e.shiftKey) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue