mirror of
https://github.com/discourse/discourse.git
synced 2025-04-26 03:04:37 +08:00
UX: Hotkey K can select partial posts
When no post is selected, K selects first partial post and J selects first full post.
This commit is contained in:
parent
5db41cd578
commit
5715f0ad01
@ -455,7 +455,11 @@ export default {
|
|||||||
const offset = minimumOffset();
|
const offset = minimumOffset();
|
||||||
$selected = $articles
|
$selected = $articles
|
||||||
.toArray()
|
.toArray()
|
||||||
.find(article => article.getBoundingClientRect().top > offset);
|
.find(article =>
|
||||||
|
direction > 0
|
||||||
|
? article.getBoundingClientRect().top > offset
|
||||||
|
: article.getBoundingClientRect().bottom > offset
|
||||||
|
);
|
||||||
if (!$selected) {
|
if (!$selected) {
|
||||||
$selected = $articles[$articles.length - 1];
|
$selected = $articles[$articles.length - 1];
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user