misc: more items & accessibility (#40883, #40884)
gitea-wip/combo/pipeline/head Build started...
Details
gitea-wip/combo/pipeline/head Build started...
Details
This commit is contained in:
parent
3baed95c28
commit
57174012c3
|
@ -25,11 +25,13 @@
|
|||
{% if form.description %}<div class="description">{{ form.description|safe }}</div>{% endif %}
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
|
||||
{% if more_forms %}
|
||||
<li class="more-items"><a>+</a></li>
|
||||
<button aria-expanded="false" aria-controls="wcs-more-forms-of-category-{{ cell.get_reference }}" aria-label="{% trans 'More forms' %}" class="more-items">+</button>
|
||||
<ul style="display: none" class="additional-forms" id="wcs-more-forms-of-category-{{ cell.get_reference }}">
|
||||
{% for form in more_forms %}
|
||||
<li style="display: none" class="additional-form {% if form.authentication_required %}required-authentication{% endif %}
|
||||
<li class="additional-form {% if form.authentication_required %}required-authentication{% endif %}
|
||||
{% for context in form.required_authentication_contexts %}required-{{context}}-authentication {% endfor %}
|
||||
{% for keyword in form.keywords %}keyword-{{keyword|slugify}} {% endfor %}
|
||||
{% if form.redirection %}is-redirection{% endif %}"
|
||||
|
|
|
@ -99,6 +99,11 @@ $(function() {
|
|||
$(this).parent().hide();
|
||||
$(this).parent().nextAll().show();
|
||||
});
|
||||
$(document).on('click', 'button.more-items', function() {
|
||||
$(this).attr('aria-expanded', 'true');
|
||||
$(this).hide();
|
||||
$('#' + $(this).attr('aria-controls')).show();
|
||||
});
|
||||
|
||||
var menu_page_ids = $.makeArray($('[data-menu-page-id]').map(function() { return $(this).data('menu-page-id'); }));
|
||||
if (menu_page_ids.length && $('body').data('check-badges') === true) {
|
||||
|
|
|
@ -7,11 +7,13 @@
|
|||
{% for link in links %}
|
||||
<li><a href="{{ link.url }}">{{ link.title }}</a></li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
|
||||
{% if more_links %}
|
||||
<li class="more-items"><a>+</a></li>
|
||||
<button aria-expanded="false" aria-controls="more-links-{{ cell.get_reference }}" aria-label="{% trans 'More links' %}" class="more-items">+</button>
|
||||
<ul style="display: none" class="additional-links" id="more-links-{{ cell.get_reference }}">
|
||||
{% for link in more_links %}
|
||||
<li style="display: none" class="additional-links"><a href="{{ link.url }}">{{ link.title }}</a></li>
|
||||
<li class="additional-link"><a href="{{ link.url }}">{{ link.title }}</a></li>
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
</ul>
|
||||
|
|
Loading…
Reference in New Issue