lint: Fix many no-unused-vars eslint rule violations.

These have been carefully audited by tabbott to ensure they are
unlikely to cause regressions.
This commit is contained in:
Rafid Aslam
2016-12-02 20:06:06 +07:00
committed by Tim Abbott
parent 80ad28bab5
commit 45f39be37f
36 changed files with 127 additions and 219 deletions

View File

@@ -98,11 +98,9 @@ exports.replace_emoji_with_text = function (element) {
var current_message_hover;
function message_unhover() {
var message;
if (current_message_hover === undefined) {
return;
}
message = current_msg_list.get(rows.id(current_message_hover));
current_message_hover.find('span.edit_content').html("");
current_message_hover.removeClass('message_hovered');
current_message_hover = undefined;
@@ -172,15 +170,6 @@ exports.report_success = function (response, status_box, type) {
ui.report_message(response, status_box, 'alert-success', type);
};
function need_skinny_mode() {
if (window.matchMedia !== undefined) {
return window.matchMedia("(max-width: 767px)").matches;
}
// IE<10 doesn't support window.matchMedia, so do this
// as best we can without it.
return window.innerWidth <= 767;
}
function update_message_in_all_views(message_id, callback) {
_.each([message_list.all, home_msg_list, message_list.narrowed], function (list) {
if (list === undefined) {
@@ -315,7 +304,7 @@ exports.lightbox_photo = function (image, user) {
$(".image-actions .open, .image-actions .download").attr("href", url);
};
exports.exit_lightbox_photo = function (image) {
exports.exit_lightbox_photo = function () {
$("#overlay").removeClass("show");
$(".player-container iframe").remove();
document.activeElement.blur();
@@ -451,30 +440,30 @@ $(function () {
$("#navbar-buttons").addClass("right-userlist");
}
$("#main_div").on("mouseover", ".message_row", function (e) {
$("#main_div").on("mouseover", ".message_row", function () {
var row = $(this).closest(".message_row");
message_hover(row);
});
$("#main_div").on("mouseleave", ".message_row", function (e) {
$("#main_div").on("mouseleave", ".message_row", function () {
message_unhover();
});
$("#main_div").on("mouseover", ".message_sender", function (e) {
$("#main_div").on("mouseover", ".message_sender", function () {
var row = $(this).closest(".message_row");
row.addClass("sender_name_hovered");
});
$("#main_div").on("mouseout", ".message_sender", function (e) {
$("#main_div").on("mouseout", ".message_sender", function () {
var row = $(this).closest(".message_row");
row.removeClass("sender_name_hovered");
});
$("#subscriptions_table").on("mouseover", ".subscription_header", function (e) {
$("#subscriptions_table").on("mouseover", ".subscription_header", function () {
$(this).addClass("active");
});
$("#subscriptions_table").on("mouseout", ".subscription_header", function (e) {
$("#subscriptions_table").on("mouseout", ".subscription_header", function () {
$(this).removeClass("active");
});
@@ -574,8 +563,6 @@ $(function () {
});
var scroll_start_message;
function scroll_finished() {
actively_scrolling = false;
@@ -613,7 +600,7 @@ function scroll_finish() {
var saved_compose_cursor = 0;
$(function () {
viewport.message_pane.scroll($.throttle(50, function (e) {
viewport.message_pane.scroll($.throttle(50, function () {
unread.process_visible();
scroll_finish();
}));