From d221cb92c6169df590e5760513e4bd91a04a4560 Mon Sep 17 00:00:00 2001 From: Satyam Bansal Date: Sun, 21 May 2023 01:45:52 +0530 Subject: [PATCH] stream_settings: Remove unused parameters after migration to tippy. --- web/src/stream_edit.js | 2 +- web/src/stream_ui_updates.js | 25 ++++--------------------- web/src/user_group_ui_updates.js | 2 -- 3 files changed, 5 insertions(+), 24 deletions(-) diff --git a/web/src/stream_edit.js b/web/src/stream_edit.js index 479e93be0d..a98732946a 100644 --- a/web/src/stream_edit.js +++ b/web/src/stream_edit.js @@ -143,7 +143,7 @@ function show_subscription_settings(sub) { } if (!stream_data.can_toggle_subscription(sub)) { - stream_ui_updates.initialize_cant_subscribe_popover(sub); + stream_ui_updates.initialize_cant_subscribe_popover(); } const $subscriber_container = $edit_container.find(".edit_subscribers_for_stream"); diff --git a/web/src/stream_ui_updates.js b/web/src/stream_ui_updates.js index fd84784943..1859fef2c5 100644 --- a/web/src/stream_ui_updates.js +++ b/web/src/stream_ui_updates.js @@ -15,12 +15,7 @@ import * as stream_edit from "./stream_edit"; import * as stream_settings_containers from "./stream_settings_containers"; import * as stream_settings_ui from "./stream_settings_ui"; -export function initialize_disable_btn_hint_popover( - $btn_wrapper, - $popover_btn, - $disabled_btn, - hint_text, -) { +export function initialize_disable_btn_hint_popover($btn_wrapper, hint_text) { tippy($btn_wrapper[0], { content: hint_text, animation: false, @@ -29,13 +24,10 @@ export function initialize_disable_btn_hint_popover( }); } -export function initialize_cant_subscribe_popover(sub) { +export function initialize_cant_subscribe_popover() { const $button_wrapper = $(".settings .stream_settings_header .sub_unsub_button_wrapper"); - const $settings_button = stream_settings_ui.settings_button_for_sub(sub); initialize_disable_btn_hint_popover( $button_wrapper, - $settings_button, - $settings_button, $t({defaultMessage: "Only stream members can add users to a private stream"}), ); } @@ -91,7 +83,7 @@ export function update_settings_button_for_sub(sub) { $settings_button.css("pointer-events", ""); } else { $settings_button.attr("title", ""); - initialize_cant_subscribe_popover(sub); + initialize_cant_subscribe_popover(); $settings_button.prop("disabled", true); } } @@ -228,10 +220,6 @@ export function update_add_subscriptions_elements(sub) { // Otherwise, we adjust whether the widgets are disabled based on // whether this user is authorized to add subscribers. - const $input_element = $add_subscribers_container.find(".input").expectOne(); - const $button_element = $add_subscribers_container - .find('button[name="add_subscriber"]') - .expectOne(); const allow_user_to_add_subs = sub.can_add_subscribers; enable_or_disable_add_subscribers_elements($add_subscribers_container, allow_user_to_add_subs); @@ -248,12 +236,7 @@ export function update_add_subscriptions_elements(sub) { defaultMessage: "Only stream members can add users to a private stream.", }); } - initialize_disable_btn_hint_popover( - $add_subscribers_container, - $input_element, - $button_element, - tooltip_message, - ); + initialize_disable_btn_hint_popover($add_subscribers_container, tooltip_message); } } diff --git a/web/src/user_group_ui_updates.js b/web/src/user_group_ui_updates.js index e5fba94bed..44483b2949 100644 --- a/web/src/user_group_ui_updates.js +++ b/web/src/user_group_ui_updates.js @@ -44,8 +44,6 @@ export function update_add_members_elements(group) { stream_ui_updates.initialize_disable_btn_hint_popover( $add_members_container, - $input_element, - $button_element, $t({defaultMessage: "Only group members can add users to a group."}), ); }