dropdown-widget: Fix alignment of disabled option.

The alignment of icon and text of the disabled option in
dropdown widget was somewhow broken due to an extra span
element present which broke the grid layout used for
rendering the icon and text properly.

This also makes the layout consistent with other options
shown with icon.

This was due to e643d7e6fd which resulted in space
between icon and text. We could have fix that by using
"~" character to remove whitespace in handlebar templates
but making the layout consistent felt a better choice.
This commit is contained in:
Sahil Batra
2025-10-02 08:51:55 +05:30
committed by Tim Abbott
parent 81ca9e1b36
commit 46f338f54f
2 changed files with 16 additions and 12 deletions

View File

@@ -24,22 +24,20 @@
</span>
</a>
{{else}}
<a class="dropdown-list-item-common-styles">
<a class="dropdown-list-item-common-styles {{#if is_setting_disabled}}setting-disabled-option{{/if}}">
{{#if stream}}
{{> inline_decorated_channel_name stream=stream show_colored_icon=true}}
{{else if is_direct_message}}
<i class="zulip-icon zulip-icon-users channel-privacy-type-icon"></i> <span class="decorated-dm-name">{{name}}</span>
{{else if is_setting_disabled}}
<span class="setting-disabled-option">
{{#if show_disabled_icon}}
<i class="setting-disabled-option-icon fa fa-ban" aria-hidden="true"></i>
{{/if}}
{{#if show_disabled_option_name}}
<span class="dropdown-list-text-neutral">{{name}}</span>
{{else}}
<span class="dropdown-list-text-neutral">{{t "Disable" }}</span>
{{/if}}
</span>
{{#if show_disabled_icon}}
<i class="setting-disabled-option-icon fa fa-ban" aria-hidden="true"></i>
{{/if}}
{{#if show_disabled_option_name}}
<span class="setting-disabled-option-text dropdown-list-text-neutral">{{name}}</span>
{{else}}
<span class="setting-disabled-option-text dropdown-list-text-neutral">{{t "Disable" }}</span>
{{/if}}
{{else if (eq unique_id -2)}}
{{!-- This is the option for PresetUrlOption.MAPPING --}}
<i class="zulip-icon zulip-icon-equal channel-privacy-type-icon" aria-hidden="true"></i> <span class="dropdown-list-text-neutral">{{name}}</span>