mirror of
https://github.com/zulip/zulip.git
synced 2025-10-23 04:52:12 +00:00
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.
29 lines
1.0 KiB
Handlebars
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>
|