mirror of
https://github.com/zulip/zulip.git
synced 2026-06-24 21:08:25 +08:00
left sidebar: Make Views label visible for spectators.
We don't include the toggle functionality, to avoid needing to design what a collapsed Views thing would look like. Fixes #30324.
This commit is contained in:
parent
6fe15626ae
commit
30f65e5e2d
@ -130,6 +130,12 @@ export function handle_narrow_activated(filter: Filter): void {
|
||||
function toggle_condensed_navigation_area(): void {
|
||||
const $views_label_container = $("#views-label-container");
|
||||
const $views_label_icon = $("#toggle-top-left-navigation-area-icon");
|
||||
|
||||
if (page_params.is_spectator) {
|
||||
// We don't support collapsing VIEWS for spectators, so exit early.
|
||||
return;
|
||||
}
|
||||
|
||||
if ($views_label_container.hasClass("showing-expanded-navigation")) {
|
||||
// Toggle into the condensed state
|
||||
$views_label_container.addClass("showing-condensed-navigation");
|
||||
|
||||
@ -219,6 +219,7 @@ export function initialize_left_sidebar(): void {
|
||||
is_recent_view_home_view:
|
||||
user_settings.web_home_view === settings_config.web_home_view_values.recent_topics.code,
|
||||
hide_unread_counts: settings_data.should_mask_unread_count(false),
|
||||
is_spectator: page_params.is_spectator,
|
||||
});
|
||||
|
||||
$("#left-sidebar-container").html(rendered_sidebar);
|
||||
|
||||
@ -812,6 +812,11 @@ li.top_left_scheduled_messages {
|
||||
}
|
||||
}
|
||||
|
||||
/* Remove the cursor: pointer property of Views label for the spectators. */
|
||||
&.remove-pointer-for-spectator {
|
||||
cursor: default;
|
||||
}
|
||||
|
||||
#toggle-top-left-navigation-area-icon {
|
||||
grid-area: starting-anchor-element;
|
||||
}
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
<div class="left-sidebar" id="left-sidebar" role="navigation">
|
||||
<div id="left-sidebar-navigation-area" class="left-sidebar-navigation-area">
|
||||
<div id="views-label-container" class="showing-expanded-navigation hidden-for-spectators">
|
||||
<i id="toggle-top-left-navigation-area-icon" class="fa fa-sm fa-caret-down views-tooltip-target" aria-hidden="true"></i>
|
||||
<div id="views-label-container" class="showing-expanded-navigation {{#if is_spectator}}remove-pointer-for-spectator{{/if}}">
|
||||
<i id="toggle-top-left-navigation-area-icon" class="fa fa-sm fa-caret-down views-tooltip-target hidden-for-spectators" aria-hidden="true"></i>
|
||||
{{~!-- squash whitespace --~}}
|
||||
<h4 class="left-sidebar-title"><span class="views-tooltip-target">{{t 'VIEWS' }}</span></h4>
|
||||
<ul id="left-sidebar-navigation-list-condensed" class="filters">
|
||||
|
||||
Loading…
Reference in New Issue
Block a user