mirror of
				https://github.com/zulip/zulip.git
				synced 2025-10-31 03:53:50 +00:00 
			
		
		
		
	This commit prepares the frontend code to be consumed by webpack. It is a hack: In theory, modules should be declaring and importing the modules they depend on and the globals they expose directly. However, that requires significant per-module work, which we don't really want to block moving our toolchain to webpack on. So we expose the modules by setting window.varName = varName; as needed in the js files.
		
			
				
	
	
		
			31 lines
		
	
	
		
			678 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
			
		
		
	
	
			31 lines
		
	
	
		
			678 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
| var list_util = (function () {
 | |
| 
 | |
| var exports = {};
 | |
| 
 | |
| 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();
 | |
| };
 | |
| 
 | |
| return exports;
 | |
| 
 | |
| }());
 | |
| 
 | |
| if (typeof module !== 'undefined') {
 | |
|     module.exports = list_util;
 | |
| }
 | |
| window.list_util = list_util;
 |