css: Introduce class which will hide elements for spectators.

`.hidden-for-spectators` class can now be used to hide elements
which should not be visible to spectators.
This commit is contained in:
Aman Agrawal 2021-06-15 14:13:15 +00:00 committed by Tim Abbott
parent d5c4495fa5
commit 99cd837421
2 changed files with 16 additions and 0 deletions

View File

@ -189,6 +189,10 @@ export function initialize_kitchen_sink_stuff() {
// box, but, close enough for now.
resize.handler();
if (page_params.is_spectator) {
$("body").addClass("spectator-view");
}
if (!page_params.left_side_userlist) {
$("#navbar-buttons").addClass("right-userlist");
}

View File

@ -551,3 +551,15 @@ div.overlay {
background-image: url(../../static/images/logo/white-zulip-logo-without-text.svg);
background-size: cover;
}
.spectator-view {
/* Add this class to elements which a
* spectator cannot use. */
.hidden-for-spectators {
display: none !important;
}
.only-visible-for-spectators {
display: unset;
}
}