FEATURE: Navigate through search results using J/K (#9264)

This commit is contained in:
Dan Ungureanu 2020-03-25 06:45:35 +02:00 committed by GitHub
parent 35e153d84f
commit 70012f2027
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 9 additions and 2 deletions

View File

@ -53,7 +53,8 @@ export let bindings = {
".topic-list tr.selected a.title",
".latest-topic-list .latest-topic-list-item.selected div.main-link a.title",
".top-topic-list .latest-topic-list-item.selected div.main-link a.title",
".latest .featured-topic.selected a.title"
".latest .featured-topic.selected a.title",
".search-results .search-link"
].join(", "),
anonymous: true
}, // open selected topic on latest or categories page
@ -589,6 +590,7 @@ export default {
const $topicList = $(".topic-list");
const $postsWrapper = $(".posts-wrapper");
const $categoriesTopicsList = this.categoriesTopicsList();
const $searchResults = $(".search-results");
if ($postsWrapper.length > 0) {
return $(".posts-wrapper .topic-post, .topic-list tbody tr");
@ -596,6 +598,8 @@ export default {
return $topicList.find(".topic-list-item");
} else if ($categoriesTopicsList.length > 0) {
return $categoriesTopicsList;
} else if ($searchResults.length > 0) {
return $searchResults.find(".fps-result");
}
},

View File

@ -192,6 +192,8 @@
.fps-result {
display: flex;
padding: 0 0.5em;
.author {
display: inline-block;
vertical-align: top;

View File

@ -5,7 +5,8 @@
.topic-list tr.selected td:first-child,
.topic-list-item.selected td:first-child,
.latest-topic-list-item.selected {
.latest-topic-list-item.selected,
.search-results .fps-result.selected {
box-shadow: inset 3px 0 0 $danger; // needs to be inset for Edge
}