mirror of
				https://github.com/zulip/zulip.git
				synced 2025-11-04 05:53:43 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			20 lines
		
	
	
		
			540 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
			
		
		
	
	
			20 lines
		
	
	
		
			540 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
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;
 |