mirror of
				https://github.com/zulip/zulip.git
				synced 2025-11-03 21:43:21 +00:00 
			
		
		
		
	drafts: Refactor keyboard functions for reusability.
This is a preparatory commit to implement keyboard navigation in the message scheduling modal. The main goal is to make the `modals_handle_events` function reusable. To achieve this, we have extracted all the context-related variables and replaced all mentions of "draft" with the more neutral term "item". The `modals_handle_events` function now also has a context parameter, which contains all the necessary methods and properties to work in different modal contexts.
This commit is contained in:
		
				
					committed by
					
						
						Tim Abbott
					
				
			
			
				
	
			
			
			
						parent
						
							0117d751c2
						
					
				
				
					commit
					35c23d0269
				
			@@ -524,8 +524,8 @@ run_test("motion_keys", () => {
 | 
			
		||||
 | 
			
		||||
    delete overlays.is_active;
 | 
			
		||||
    overlays.drafts_open = () => true;
 | 
			
		||||
    assert_mapping("up_arrow", drafts, "drafts_handle_events");
 | 
			
		||||
    assert_mapping("down_arrow", drafts, "drafts_handle_events");
 | 
			
		||||
    assert_mapping("up_arrow", drafts, "handle_keyboard_events");
 | 
			
		||||
    assert_mapping("down_arrow", drafts, "handle_keyboard_events");
 | 
			
		||||
    delete overlays.is_active;
 | 
			
		||||
    delete overlays.drafts_open;
 | 
			
		||||
});
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user