rustdoc: Detect repeated keys and fix width

When a key is pressed and held, this now does the OS-style repeating after a bit
of a pause. Also fixes the width of search results to be correct (was changed
beforehand and didn't catch this).
This commit is contained in:
Alex Crichton 2013-09-30 15:35:29 -07:00
parent 863555f4fd
commit cc1791584f

View File

@ -224,8 +224,8 @@
}, 20);
});
$(document).off('keyup.searchnav');
$(document).on('keyup.searchnav', function (e) {
$(document).off('keypress.searchnav');
$(document).on('keypress.searchnav', function (e) {
var $active = $results.filter('.highlighted');
if (e.keyCode === 38) { // up
@ -321,8 +321,8 @@
output += "</p>";
$('#main.content').addClass('hidden');
$('#search.content').removeClass('hidden').html(output);
$('.search-results .desc').width($('.content').width() - 40 -
$('.content td:first-child').first().width());
$('#search .desc').width($('#search').width() - 40 -
$('#search td:first-child').first().width());
initSearchNav();
}