mirror of
				https://github.com/zulip/zulip.git
				synced 2025-11-04 05:53:43 +00:00 
			
		
		
		
	js: Convert _.indexOf(a, …) to a.indexOf(…).
Signed-off-by: Anders Kaseorg <anders@zulipchat.com>
This commit is contained in:
		
				
					committed by
					
						
						Tim Abbott
					
				
			
			
				
	
			
			
			
						parent
						
							29dbf8ec77
						
					
				
				
					commit
					788c5afbcf
				
			@@ -9,7 +9,7 @@ function add_pending_request(jqXHR) {
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
function remove_pending_request(jqXHR) {
 | 
			
		||||
    const pending_request_index = _.indexOf(pending_requests, jqXHR);
 | 
			
		||||
    const pending_request_index = pending_requests.indexOf(jqXHR);
 | 
			
		||||
    if (pending_request_index !== -1) {
 | 
			
		||||
        pending_requests.splice(pending_request_index, 1);
 | 
			
		||||
    }
 | 
			
		||||
 
 | 
			
		||||
@@ -142,7 +142,7 @@ exports.update_messages = function update_messages(events) {
 | 
			
		||||
            // where the user initiated the edit.
 | 
			
		||||
            topic_edited = true;
 | 
			
		||||
 | 
			
		||||
            const going_forward_change = _.indexOf(['change_later', 'change_all'], event.propagate_mode) >= 0;
 | 
			
		||||
            const going_forward_change = ['change_later', 'change_all'].indexOf(event.propagate_mode) >= 0;
 | 
			
		||||
 | 
			
		||||
            const stream_name = stream_data.get_sub_by_id(event.stream_id).name;
 | 
			
		||||
            const compose_stream_name = compose_state.stream_name();
 | 
			
		||||
@@ -161,7 +161,7 @@ exports.update_messages = function update_messages(events) {
 | 
			
		||||
            const current_filter = narrow_state.filter();
 | 
			
		||||
            if (going_forward_change) {
 | 
			
		||||
                const current_id = current_msg_list.selected_id();
 | 
			
		||||
                const selection_changed_topic = _.indexOf(event.message_ids, current_id) >= 0;
 | 
			
		||||
                const selection_changed_topic = event.message_ids.indexOf(current_id) >= 0;
 | 
			
		||||
                if (selection_changed_topic) {
 | 
			
		||||
                    if (current_filter && stream_name) {
 | 
			
		||||
                        if (current_filter.has_topic(stream_name, orig_topic)) {
 | 
			
		||||
 
 | 
			
		||||
@@ -80,7 +80,7 @@ exports.wrap = function (lst, val) {
 | 
			
		||||
        return exports.list_generator(lst);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    const i = _.indexOf(lst, val);
 | 
			
		||||
    const i = lst.indexOf(val);
 | 
			
		||||
    if (i < 0) {
 | 
			
		||||
        return exports.list_generator(lst);
 | 
			
		||||
    }
 | 
			
		||||
@@ -98,7 +98,7 @@ exports.wrap_exclude = function (lst, val) {
 | 
			
		||||
        return exports.list_generator(lst);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    const i = _.indexOf(lst, val);
 | 
			
		||||
    const i = lst.indexOf(val);
 | 
			
		||||
    if (i < 0) {
 | 
			
		||||
        return exports.list_generator(lst);
 | 
			
		||||
    }
 | 
			
		||||
@@ -116,7 +116,7 @@ exports.reverse_wrap_exclude = function (lst, val) {
 | 
			
		||||
        return exports.reverse_list_generator(lst);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    const i = _.indexOf(lst, val);
 | 
			
		||||
    const i = lst.indexOf(val);
 | 
			
		||||
    if (i < 0) {
 | 
			
		||||
        return exports.reverse_list_generator(lst);
 | 
			
		||||
    }
 | 
			
		||||
 
 | 
			
		||||
@@ -12,7 +12,7 @@ function is_image_format(file) {
 | 
			
		||||
    if (!type) {
 | 
			
		||||
        return false;
 | 
			
		||||
    }
 | 
			
		||||
    return _.indexOf(supported_types, type) >= 0;
 | 
			
		||||
    return supported_types.indexOf(type) >= 0;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
exports.build_widget = function (
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user