From 7f14dc4bbbca7c75625bd664a026deb72501e86a Mon Sep 17 00:00:00 2001 From: rimu <3310831+rimu@users.noreply.github.com> Date: Sat, 20 Jan 2024 10:07:23 +1300 Subject: [PATCH] more keyboard shortcuts --- app/static/js/scripts.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/static/js/scripts.js b/app/static/js/scripts.js index 176f33f4..0c407d21 100644 --- a/app/static/js/scripts.js +++ b/app/static/js/scripts.js @@ -388,8 +388,8 @@ function setupKeyboardShortcuts() { didSomething = true; } } else if (event.key === 'Enter') { - if(document.activeElement.classList.contains('downvote_button') || document.activeElement.classList.contains('upvote_button')) { - document.activeElement.click(); + if(currentPost) { + currentPost.querySelector('.post_teaser_title_a').click(); didSomething = true; } }