Files
zulip/static/js/list_util.js
Anders Kaseorg d17b577d0c js: Purge useless IIFEs.
With webpack, variables declared in each file are already file-local
(Global variables need to be explicitly exported), so these IIFEs are
no longer needed.

Signed-off-by: Anders Kaseorg <andersk@mit.edu>
2019-10-25 13:51:21 -07:00

20 lines
530 B
JavaScript

var list_selectors = ["#group-pm-list", "#stream_filters", "#global_filters", "#user_presences"];
exports.inside_list = function (e) {
var $target = $(e.target);
var in_list = $target.closest(list_selectors.join(", ")).length > 0;
return in_list;
};
exports.go_down = function (e) {
var $target = $(e.target);
$target.closest("li").next().find("a").focus();
};
exports.go_up = function (e) {
var $target = $(e.target);
$target.closest("li").prev().find("a").focus();
};
window.list_util = exports;