mirror of
				https://github.com/zulip/zulip.git
				synced 2025-10-31 12:03:46 +00:00 
			
		
		
		
	hotkeys: Handle up/down arrows in settings page.
The up/down arrows now navigate the left pane of the settings menu. The code here was originally implemented as part of our settings redesign, but the code was added in a place that became unreachable after we fixed a bug with home_tab_obscured(). This commit resurrects the code and places the guts of it in settings.js. It is possible that we want to clean this code up eventually to deal better with hidden blocks.
This commit is contained in:
		| @@ -1040,6 +1040,22 @@ exports.launch_page = function (tab) { | ||||
|     $active_tab.click(); | ||||
| }; | ||||
|  | ||||
| exports.handle_up_arrow = function (e) { | ||||
|     var prev = e.target.previousElementSibling; | ||||
|  | ||||
|     if ($(prev).css("display") !== "none") { | ||||
|         $(prev).focus().click(); | ||||
|     } | ||||
| }; | ||||
|  | ||||
| exports.handle_down_arrow = function (e) { | ||||
|     var next = e.target.nextElementSibling; | ||||
|  | ||||
|     if ($(next).css("display") !== "none") { | ||||
|         $(next).focus().click(); | ||||
|     } | ||||
| }; | ||||
|  | ||||
| return exports; | ||||
| }()); | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user