Files
zulip/web/templates/components/banner.hbs
Maneesh Shukla bfdd28c638 banners: Hide empty banner-action-buttons using CSS.
Previously, the action buttons container was only hidden via
conditional rendering in the template. This commit adds a CSS-based
approach to also hide the container when it becomes empty, using the
:empty pseudo-class. This ensures correct behavior if we later have a
class of banners where the buttons area is dynamically updated, and
buttons are removed dynamically.
2025-08-13 10:31:18 -07:00

29 lines
1.0 KiB
Handlebars

<div {{#if process}}data-process="{{process}}"{{/if}} class="{{#if custom_classes}}{{custom_classes}} {{/if}}banner banner-{{intent}}">
<span class="banner-content">
<span class="banner-label">
{{#if label}}
{{label}}
{{else}}
{{> @partial-block .}}
{{/if}}
</span>
{{#if buttons}}
<span class="banner-action-buttons">
{{!-- squash whitespace so :empty selector works when no buttons --}}
{{~!-- squash whitespace --~}}
{{#each buttons}}
{{#if this.intent}}
{{> action_button .}}
{{else}}
{{> action_button . intent=../intent}}
{{/if}}
{{/each}}
{{~!-- squash whitespace --~}}
</span>
{{/if}}
</span>
{{#if close_button}}
{{> icon_button custom_classes="banner-close-action banner-close-button" icon="close" intent=intent}}
{{/if}}
</div>