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:
Jeff Wong 2021-12-08 21:38:25 -10:00 committed by GitHub
parent 828e75c2f3
commit 347669ef04
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 0 deletions

View File

@ -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) {