recent_topics: Directly pass jquery element instead of event object.

This commit is contained in:
Aman Agrawal
2021-03-16 14:15:33 +00:00
committed by Tim Abbott
parent 493c00f2ad
commit f79a59d5f8
3 changed files with 15 additions and 13 deletions

View File

@@ -216,7 +216,10 @@ export function in_content_editable_widget(e) {
// Returns true if we handled it, false if the browser should.
export function process_escape_key(e) {
if (hashchange.in_recent_topics_hash() && recent_topics.change_focused_element(e, "escape")) {
if (
hashchange.in_recent_topics_hash() &&
recent_topics.change_focused_element($(e.target), "escape")
) {
// Recent topics uses escape to make focus from RT search / filters to topics table.
// If focus already in table it returns false.
return true;
@@ -532,7 +535,7 @@ export function process_hotkey(e, hotkey) {
!$(".user-list-filter").is(":focus") &&
!$(".stream-list-filter").is(":focus")
) {
return recent_topics.change_focused_element(e, event_name);
return recent_topics.change_focused_element($(e.target), event_name);
}
}