diff --git a/options/options.twig b/options/options.twig index 589c4b0..29bc410 100644 --- a/options/options.twig +++ b/options/options.twig @@ -164,7 +164,18 @@ {% set aTabs = aTabs|merge([{ 'id': 'top-of-page', 'label': 'Top of the page', 'category': 'Top of the page', 'keys': aTopOfPageKeys }]) %} {% for category in aOptionAttributes.categories %} {% if category != 'Fonts' and category != 'Top of the page' %} - {% set aTabs = aTabs|merge([{ 'id': 'category-' ~ category|lower|replace({' ': '-'}), 'label': category, 'category': category, 'keys': null }]) %} + {# Resolve this category's keys once and skip the tab entirely when none + remain (Prompt S): e.g. "Progress" — its only option (progressbarposition) + moved to the Top-of-page tab, so an empty tab must not be rendered. #} + {% set catKeys = [] %} + {% for key, attr in aOptionAttributes.optionAttributes %} + {% if key != 'ajaxmode' and attr.category == category and key not in aTopOfPageKeys %} + {% set catKeys = catKeys|merge([key]) %} + {% endif %} + {% endfor %} + {% if catKeys is not empty %} + {% set aTabs = aTabs|merge([{ 'id': 'category-' ~ category|lower|replace({' ': '-'}), 'label': category, 'category': category, 'keys': null }]) %} + {% endif %} {% endif %} {% endfor %}