mirror of
https://github.com/discourse/discourse.git
synced 2024-11-22 15:16:08 +08:00
DEV: Add keyboard:move selection event (#15241)
allows plugin event hook for keyboard:move-selection. Passes raw selected and all articles through named params.
This commit is contained in:
parent
828e75c2f3
commit
347669ef04
|
@ -682,6 +682,10 @@ export default {
|
|||
if ($article.length > 0) {
|
||||
$articles.removeClass("selected");
|
||||
$article.addClass("selected");
|
||||
this.appEvents.trigger("keyboard:move-selection", {
|
||||
articles: $articles.get(),
|
||||
selectedArticle: $article.get(0),
|
||||
});
|
||||
|
||||
const articleRect = $article[0].getBoundingClientRect();
|
||||
if (!fast && direction < 0 && articleRect.height > window.innerHeight) {
|
||||
|
|
Loading…
Reference in New Issue
Block a user