(doc) Properly doc hotkeys in generated docs.
Updated search bar to match help text. Used correct, normalized hotkeys in search. Updated shortcut menu with working shortcuts (tabs). Changed height of search help.
This commit is contained in:
parent
bb06790c37
commit
677e6ed603
@ -63,7 +63,7 @@ r##"<!DOCTYPE html>
|
|||||||
<div class="search-container">
|
<div class="search-container">
|
||||||
<input class="search-input" name="search"
|
<input class="search-input" name="search"
|
||||||
autocomplete="off"
|
autocomplete="off"
|
||||||
placeholder="Click or press 's' to search, '?' for more options..."
|
placeholder="Click or press 'S' to search, '?' for more options..."
|
||||||
type="search">
|
type="search">
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
@ -82,9 +82,9 @@ r##"<!DOCTYPE html>
|
|||||||
<dd>Show this help dialog</dd>
|
<dd>Show this help dialog</dd>
|
||||||
<dt>S</dt>
|
<dt>S</dt>
|
||||||
<dd>Focus the search field</dd>
|
<dd>Focus the search field</dd>
|
||||||
<dt>↑</dt>
|
<dt>⇤</dt>
|
||||||
<dd>Move up in search results</dd>
|
<dd>Move up in search results</dd>
|
||||||
<dt>↓</dt>
|
<dt>⇥</dt>
|
||||||
<dd>Move down in search results</dd>
|
<dd>Move down in search results</dd>
|
||||||
<dt>⏎</dt>
|
<dt>⏎</dt>
|
||||||
<dd>Go to active search result</dd>
|
<dd>Go to active search result</dd>
|
||||||
|
@ -347,7 +347,7 @@ p a:hover { text-decoration: underline; }
|
|||||||
margin-top: -125px;
|
margin-top: -125px;
|
||||||
margin-left: -275px;
|
margin-left: -275px;
|
||||||
width: 550px;
|
width: 550px;
|
||||||
height: 250px;
|
height: 300px;
|
||||||
border: 1px solid #bfbfbf;
|
border: 1px solid #bfbfbf;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -71,10 +71,10 @@
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (e.keyCode === 188 && $('#help').hasClass('hidden')) { // question mark
|
if (e.which === 191 && $('#help').hasClass('hidden')) { // question mark
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
$('#help').removeClass('hidden');
|
$('#help').removeClass('hidden');
|
||||||
} else if (e.keyCode === 27) { // esc
|
} else if (e.which === 27) { // esc
|
||||||
if (!$('#help').hasClass('hidden')) {
|
if (!$('#help').hasClass('hidden')) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
$('#help').addClass('hidden');
|
$('#help').addClass('hidden');
|
||||||
@ -83,7 +83,7 @@
|
|||||||
$('#search').addClass('hidden');
|
$('#search').addClass('hidden');
|
||||||
$('#main').removeClass('hidden');
|
$('#main').removeClass('hidden');
|
||||||
}
|
}
|
||||||
} else if (e.keyCode === 83) { // S
|
} else if (e.which === 83) { // S
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
$('.search-input').focus();
|
$('.search-input').focus();
|
||||||
}
|
}
|
||||||
@ -361,7 +361,7 @@
|
|||||||
$(document).on('keypress.searchnav', function(e) {
|
$(document).on('keypress.searchnav', function(e) {
|
||||||
var $active = $results.filter('.highlighted');
|
var $active = $results.filter('.highlighted');
|
||||||
|
|
||||||
if (e.keyCode === 38) { // up
|
if (e.which === 38) { // up
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
if (!$active.length || !$active.prev()) {
|
if (!$active.length || !$active.prev()) {
|
||||||
return;
|
return;
|
||||||
@ -369,7 +369,7 @@
|
|||||||
|
|
||||||
$active.prev().addClass('highlighted');
|
$active.prev().addClass('highlighted');
|
||||||
$active.removeClass('highlighted');
|
$active.removeClass('highlighted');
|
||||||
} else if (e.keyCode === 40) { // down
|
} else if (e.which === 40) { // down
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
if (!$active.length) {
|
if (!$active.length) {
|
||||||
$results.first().addClass('highlighted');
|
$results.first().addClass('highlighted');
|
||||||
@ -377,7 +377,7 @@
|
|||||||
$active.next().addClass('highlighted');
|
$active.next().addClass('highlighted');
|
||||||
$active.removeClass('highlighted');
|
$active.removeClass('highlighted');
|
||||||
}
|
}
|
||||||
} else if (e.keyCode === 13) { // return
|
} else if (e.which === 13) { // return
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
if ($active.length) {
|
if ($active.length) {
|
||||||
document.location.href = $active.find('a').prop('href');
|
document.location.href = $active.find('a').prop('href');
|
||||||
|
Loading…
Reference in New Issue
Block a user