2020-08-01 03:43:15 +02:00
|
|
|
"use strict";
|
|
|
|
|
2020-05-26 13:58:18 +02:00
|
|
|
const list_selectors = ["#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);
|
2020-07-20 21:24:26 +02:00
|
|
|
$target.closest("li").next().find("a").trigger("focus");
|
2017-04-04 18:14:27 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
exports.go_up = function (e) {
|
2019-11-02 00:06:25 +01:00
|
|
|
const $target = $(e.target);
|
2020-07-20 21:24:26 +02:00
|
|
|
$target.closest("li").prev().find("a").trigger("focus");
|
2017-04-04 18:14:27 +02:00
|
|
|
};
|
|
|
|
|
2019-10-25 09:45:13 +02:00
|
|
|
window.list_util = exports;
|