mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
UX: Keyboard shortcuts will automatically select hovered post
This commit is contained in:
parent
cdea969c6a
commit
758fae7f9f
@ -297,10 +297,14 @@ export default {
|
||||
sendToSelectedPost(action) {
|
||||
const container = this.container;
|
||||
// TODO: We should keep track of the post without a CSS class
|
||||
const selectedPostId = parseInt(
|
||||
let selectedPostId = parseInt(
|
||||
$(".topic-post.selected article.boxed").data("post-id"),
|
||||
10
|
||||
);
|
||||
if (!selectedPostId) {
|
||||
// If no post was selected, automatically select the hovered post.
|
||||
selectedPostId = parseInt($("article.boxed:hover").data("post-id"), 10);
|
||||
}
|
||||
if (selectedPostId) {
|
||||
const topicController = container.lookup("controller:topic");
|
||||
const post = topicController
|
||||
|
Loading…
Reference in New Issue
Block a user