mirror of
https://github.com/zulip/zulip.git
synced 2026-06-24 21:08:25 +08:00
ES and TypeScript modules are strict by default and don’t need this directive. ESLint will remind us to add it to new CommonJS files and remove it from ES and TypeScript modules. Signed-off-by: Anders Kaseorg <[email protected]>
22 lines
555 B
JavaScript
22 lines
555 B
JavaScript
"use strict";
|
|
|
|
const list_selectors = ["#stream_filters", "#global_filters", "#user_presences"];
|
|
|
|
exports.inside_list = function (e) {
|
|
const $target = $(e.target);
|
|
const in_list = $target.closest(list_selectors.join(", ")).length > 0;
|
|
return in_list;
|
|
};
|
|
|
|
exports.go_down = function (e) {
|
|
const $target = $(e.target);
|
|
$target.closest("li").next().find("a").trigger("focus");
|
|
};
|
|
|
|
exports.go_up = function (e) {
|
|
const $target = $(e.target);
|
|
$target.closest("li").prev().find("a").trigger("focus");
|
|
};
|
|
|
|
window.list_util = exports;
|