mirror of
https://github.com/discourse/discourse.git
synced 2025-03-04 02:04:10 +08:00
fix scrolling while clicking up and down on search results
This commit is contained in:
parent
7ca5ab3da3
commit
4714d31c01
@ -1,5 +1,5 @@
|
|||||||
{{#with view.content}}
|
{{#with view.content}}
|
||||||
<a href='{{unbound url}}'>
|
<a href='{{unbound url}}'>
|
||||||
{{unbound title}}
|
{{unbound title}}
|
||||||
</a>
|
</a>
|
||||||
{{/with}}
|
{{/with}}
|
||||||
|
@ -18,12 +18,18 @@ Discourse.SearchView = Discourse.View.extend({
|
|||||||
return $('body').on('keydown.search', function(e) {
|
return $('body').on('keydown.search', function(e) {
|
||||||
if ($('#search-dropdown').is(':visible')) {
|
if ($('#search-dropdown').is(':visible')) {
|
||||||
switch (e.which) {
|
switch (e.which) {
|
||||||
case 13:
|
case 13:
|
||||||
return controller.select();
|
controller.select();
|
||||||
case 38:
|
e.preventDefault();
|
||||||
return controller.moveUp();
|
break;
|
||||||
case 40:
|
case 38:
|
||||||
return controller.moveDown();
|
controller.moveUp();
|
||||||
|
e.preventDefault();
|
||||||
|
break;
|
||||||
|
case 40:
|
||||||
|
controller.moveDown();
|
||||||
|
e.preventDefault();
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user