2019-11-02 00:06:25 +01:00
|
|
|
const list_selectors = ["#group-pm-list", "#stream_filters", "#global_filters", "#user_presences"];
|
2017-04-04 18:14:27 +02:00
|
|
|
|
|
|
|
exports.inside_list = function (e) {
|
2019-11-02 00:06:25 +01:00
|
|
|
const $target = $(e.target);
|
|
|
|
const in_list = $target.closest(list_selectors.join(", ")).length > 0;
|
2017-04-04 18:14:27 +02:00
|
|
|
return in_list;
|
|
|
|
};
|
|
|
|
|
|
|
|
exports.go_down = function (e) {
|
2019-11-02 00:06:25 +01:00
|
|
|
const $target = $(e.target);
|
2017-04-04 18:14:27 +02:00
|
|
|
$target.closest("li").next().find("a").focus();
|
|
|
|
};
|
|
|
|
|
|
|
|
exports.go_up = function (e) {
|
2019-11-02 00:06:25 +01:00
|
|
|
const $target = $(e.target);
|
2017-04-04 18:14:27 +02:00
|
|
|
$target.closest("li").prev().find("a").focus();
|
|
|
|
};
|
|
|
|
|
2019-10-25 09:45:13 +02:00
|
|
|
window.list_util = exports;
|