diff --git a/static/js/channel.js b/static/js/channel.js index 50fee79743..60bed8f69f 100644 --- a/static/js/channel.js +++ b/static/js/channel.js @@ -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); } diff --git a/static/js/message_events.js b/static/js/message_events.js index 68c94bc272..a14b68c5de 100644 --- a/static/js/message_events.js +++ b/static/js/message_events.js @@ -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)) { diff --git a/static/js/topic_generator.js b/static/js/topic_generator.js index 0ef93dfc79..4ceace1cf6 100644 --- a/static/js/topic_generator.js +++ b/static/js/topic_generator.js @@ -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); } diff --git a/static/js/upload_widget.js b/static/js/upload_widget.js index f315856703..a082eaca3e 100644 --- a/static/js/upload_widget.js +++ b/static/js/upload_widget.js @@ -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 (