mirror of
https://github.com/zulip/zulip.git
synced 2025-11-17 20:41:46 +00:00
js: Clean up poorly named const id variables.
We have conventions for naming message_id, stream_id, etc. values that way for readability; these entries are violations of those conventions.
This commit is contained in:
@@ -589,8 +589,8 @@ exports.open_message_menu = function (message) {
|
||||
return true;
|
||||
}
|
||||
|
||||
const id = message.id;
|
||||
exports.toggle_actions_popover($(".selected_message .actions_hover")[0], id);
|
||||
const message_id = message.id;
|
||||
exports.toggle_actions_popover($(".selected_message .actions_hover")[0], message_id);
|
||||
if (current_actions_popover_elem) {
|
||||
focus_first_action_popover_item();
|
||||
}
|
||||
@@ -741,11 +741,11 @@ exports.register_click_handlers = function () {
|
||||
});
|
||||
|
||||
$("#main_div").on("click", ".user-group-mention", function (e) {
|
||||
const id = parseInt($(this).attr('data-user-group-id'), 10);
|
||||
const user_group_id = parseInt($(this).attr('data-user-group-id'), 10);
|
||||
const row = $(this).closest(".message_row");
|
||||
e.stopPropagation();
|
||||
const message = current_msg_list.get(rows.id(row));
|
||||
const group = user_groups.get_user_group_from_id(id, true);
|
||||
const group = user_groups.get_user_group_from_id(user_group_id, true);
|
||||
if (group === undefined) {
|
||||
// This user group has likely been deleted.
|
||||
blueslip.info('Unable to find user group in message' + message.sender_id);
|
||||
@@ -928,8 +928,8 @@ exports.register_click_handlers = function () {
|
||||
});
|
||||
|
||||
function reminder_click_handler(datestr, e) {
|
||||
const id = $(".remind.custom").data('message-id');
|
||||
reminder.do_set_reminder_for_message(id, datestr);
|
||||
const message_id = $(".remind.custom").data('message-id');
|
||||
reminder.do_set_reminder_for_message(message_id, datestr);
|
||||
exports.hide_all();
|
||||
e.stopPropagation();
|
||||
e.preventDefault();
|
||||
@@ -1051,8 +1051,8 @@ exports.register_click_handlers = function () {
|
||||
|
||||
$('body').on('click', '.copy_link', function (e) {
|
||||
exports.hide_actions_popover();
|
||||
const id = $(this).attr("data-message-id");
|
||||
const row = $("[zid='" + id + "']");
|
||||
const message_id = $(this).attr("data-message-id");
|
||||
const row = $("[zid='" + message_id + "']");
|
||||
row.find(".alert-msg")
|
||||
.text(i18n.t("Copied!"))
|
||||
.css("display", "block")
|
||||
|
||||
@@ -59,17 +59,17 @@ exports.set_colorpicker_color = function (colorpicker, color) {
|
||||
exports.update_stream_color = function (sub, color, opts) {
|
||||
opts = _.defaults({}, opts, {update_historical: false});
|
||||
sub.color = color;
|
||||
const id = sub.stream_id;
|
||||
const stream_id = sub.stream_id;
|
||||
// The swatch in the subscription row header.
|
||||
$(".stream-row[data-stream-id='" + id + "'] .icon").css('background-color', color);
|
||||
$(".stream-row[data-stream-id='" + stream_id + "'] .icon").css('background-color', color);
|
||||
// The swatch in the color picker.
|
||||
exports.set_colorpicker_color($("#subscription_overlay .subscription_settings[data-stream-id='" + id + "'] .colorpicker"), color);
|
||||
$("#subscription_overlay .subscription_settings[data-stream-id='" + id + "'] .large-icon").css("color", color);
|
||||
exports.set_colorpicker_color($("#subscription_overlay .subscription_settings[data-stream-id='" + stream_id + "'] .colorpicker"), color);
|
||||
$("#subscription_overlay .subscription_settings[data-stream-id='" + stream_id + "'] .large-icon").css("color", color);
|
||||
|
||||
if (opts.update_historical) {
|
||||
update_historical_message_color(sub.name, color);
|
||||
}
|
||||
update_stream_sidebar_swatch_color(id, color);
|
||||
update_stream_sidebar_swatch_color(stream_id, color);
|
||||
if (!page_params.search_pills_enabled) {
|
||||
tab_bar.colorize_tab_bar();
|
||||
}
|
||||
|
||||
@@ -19,8 +19,7 @@ exports.setup_subscriptions_tab_hash = function (tab_key_value) {
|
||||
};
|
||||
|
||||
exports.settings_for_sub = function (sub) {
|
||||
const id = sub.stream_id;
|
||||
return $("#subscription_overlay .subscription_settings[data-stream-id='" + id + "']");
|
||||
return $("#subscription_overlay .subscription_settings[data-stream-id='" + sub.stream_id + "']");
|
||||
};
|
||||
|
||||
exports.is_sub_settings_active = function (sub) {
|
||||
@@ -96,8 +95,8 @@ function format_member_list_elem(email) {
|
||||
}
|
||||
|
||||
function get_subscriber_list(sub_row) {
|
||||
const id = sub_row.data("stream-id");
|
||||
return $('.subscription_settings[data-stream-id="' + id + '"] .subscriber-list');
|
||||
const stream_id_str = sub_row.data("stream-id");
|
||||
return $('.subscription_settings[data-stream-id="' + stream_id_str + '"] .subscriber-list');
|
||||
}
|
||||
|
||||
exports.update_stream_name = function (sub, new_name) {
|
||||
|
||||
@@ -15,8 +15,7 @@ exports.show_subs_pane = {
|
||||
};
|
||||
|
||||
exports.check_button_for_sub = function (sub) {
|
||||
const id = sub.stream_id;
|
||||
return $(".stream-row[data-stream-id='" + id + "'] .check");
|
||||
return $(".stream-row[data-stream-id='" + sub.stream_id + "'] .check");
|
||||
};
|
||||
|
||||
exports.row_for_stream_id = function (stream_id) {
|
||||
@@ -26,8 +25,7 @@ exports.row_for_stream_id = function (stream_id) {
|
||||
exports.settings_button_for_sub = function (sub) {
|
||||
// We don't do expectOne() here, because this button is only
|
||||
// visible if the user has that stream selected in the streams UI.
|
||||
const id = sub.stream_id;
|
||||
return $(".subscription_settings[data-stream-id='" + id + "'] .subscribe-button");
|
||||
return $(".subscription_settings[data-stream-id='" + sub.stream_id + "'] .subscribe-button");
|
||||
};
|
||||
|
||||
function get_row_data(row) {
|
||||
|
||||
Reference in New Issue
Block a user