mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-27 17:46:05 -05:00
fix scrolling while clicking up and down on search results
This commit is contained in:
parent
7ca5ab3da3
commit
4714d31c01
2 changed files with 13 additions and 7 deletions
|
@ -1,5 +1,5 @@
|
|||
{{#with view.content}}
|
||||
<a href='{{unbound url}}'>
|
||||
<a href='{{unbound url}}'>
|
||||
{{unbound title}}
|
||||
</a>
|
||||
{{/with}}
|
||||
|
|
|
@ -18,12 +18,18 @@ Discourse.SearchView = Discourse.View.extend({
|
|||
return $('body').on('keydown.search', function(e) {
|
||||
if ($('#search-dropdown').is(':visible')) {
|
||||
switch (e.which) {
|
||||
case 13:
|
||||
return controller.select();
|
||||
case 38:
|
||||
return controller.moveUp();
|
||||
case 40:
|
||||
return controller.moveDown();
|
||||
case 13:
|
||||
controller.select();
|
||||
e.preventDefault();
|
||||
break;
|
||||
case 38:
|
||||
controller.moveUp();
|
||||
e.preventDefault();
|
||||
break;
|
||||
case 40:
|
||||
controller.moveDown();
|
||||
e.preventDefault();
|
||||
break;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue