mirror of
				https://github.com/zulip/zulip.git
				synced 2025-11-03 21:43:21 +00:00 
			
		
		
		
	hotkey.js: Simplify ctrl+[ hotkey logic.
This commit is contained in:
		@@ -99,7 +99,7 @@ function stubbing(func_name_to_stub, test_function) {
 | 
			
		||||
    assert.equal(map_press(47).name, 'search'); // slash
 | 
			
		||||
    assert.equal(map_press(106).name, 'vim_down'); // j
 | 
			
		||||
 | 
			
		||||
    assert.equal(map_down(219, false, true).name, 'esc_ctrl');
 | 
			
		||||
    assert.equal(map_down(219, false, true).name, 'escape');
 | 
			
		||||
 | 
			
		||||
    // More negative tests.
 | 
			
		||||
    assert.equal(map_down(47), undefined);
 | 
			
		||||
 
 | 
			
		||||
@@ -41,7 +41,7 @@ var keydown_unshift_mappings = {
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
var keydown_ctrl_mappings = {
 | 
			
		||||
    219: {name: 'esc_ctrl', message_view_only: false}, // '['
 | 
			
		||||
    219: {name: 'escape', message_view_only: false}, // '['
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
var keydown_either_mappings = {
 | 
			
		||||
@@ -398,8 +398,6 @@ exports.process_hotkey = function (e, hotkey) {
 | 
			
		||||
            return exports.process_tab_key();
 | 
			
		||||
        case 'shift_tab':
 | 
			
		||||
            return exports.process_shift_tab_key();
 | 
			
		||||
        case 'esc_ctrl':
 | 
			
		||||
            return exports.process_escape_key(e);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    switch (event_name) {
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user