mirror of https://github.com/zulip/zulip.git
stream-settings: Refactor code to pass sub object to title template.
This commit refactors the code to directly pass sub object to selected_stream_title template instead of passing name, is_web_public and invite_only as different parameters.
This commit is contained in:
parent
5688d8b0df
commit
12efde8a51
|
@ -138,7 +138,7 @@ export function open_edit_panel_for_row(stream_row) {
|
|||
const sub = get_sub_for_target(stream_row);
|
||||
|
||||
$(".stream-row.active").removeClass("active");
|
||||
stream_settings_ui.show_subs_pane.settings(sub.name, sub.invite_only, sub.is_web_public);
|
||||
stream_settings_ui.show_subs_pane.settings(sub);
|
||||
$(stream_row).addClass("active");
|
||||
setup_subscriptions_stream_hash(sub);
|
||||
setup_stream_settings(stream_row);
|
||||
|
|
|
@ -45,16 +45,10 @@ export const show_subs_pane = {
|
|||
$(".nothing-selected").show();
|
||||
$("#subscription_overlay .stream-info-title").text($t({defaultMessage: "Stream settings"}));
|
||||
},
|
||||
settings(stream_name, invite_only, is_web_public) {
|
||||
settings(sub) {
|
||||
$(".settings, #stream-creation").hide();
|
||||
$(".settings").show();
|
||||
$("#subscription_overlay .stream-info-title").html(
|
||||
render_selected_stream_title({
|
||||
stream_name,
|
||||
invite_only,
|
||||
is_web_public,
|
||||
}),
|
||||
);
|
||||
$("#subscription_overlay .stream-info-title").html(render_selected_stream_title(sub));
|
||||
},
|
||||
create_stream() {
|
||||
$(".nothing-selected, .settings, #stream-creation").hide();
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
{{> stream_privacy_icon
|
||||
invite_only=invite_only
|
||||
is_web_public=is_web_public }}
|
||||
<span class="stream-name-title">{{stream_name}}</span>
|
||||
is_web_public=is_web_public
|
||||
color="#000000" }}
|
||||
<span class="stream-name-title">{{name}}</span>
|
||||
|
|
Loading…
Reference in New Issue