提交 80efb220 编写于 作者: A Alex Crichton

rustdoc: Bind keydown instead of keypress for nav

Apparently keypress doesn't quite work in all browsers due to some not invoking
the handler and jquery not setting the right `which` field in all circumstances.
According to http://stackoverflow.com/questions/2166771 switching over to
`keydown` works and it appears to do the trick. Tested in Safari, Firefox, and
Chrome.

Closes #15011
上级 724bcec0
......@@ -357,8 +357,8 @@
}, 20);
});
$(document).off('keypress.searchnav');
$(document).on('keypress.searchnav', function(e) {
$(document).off('keydown.searchnav');
$(document).on('keydown.searchnav', function(e) {
var $active = $results.filter('.highlighted');
if (e.which === 38) { // up
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册