Skip to content

Commit

Permalink
Wrap accordion label in a span
Browse files Browse the repository at this point in the history
  • Loading branch information
tienvx committed Oct 18, 2021
1 parent 295cf68 commit 2d0d313
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ UX Collection JS requires PHP 7.4+ and Symfony 4.4+.
Install this bundle using Composer and Symfony Flex:

```sh
composer require tienvx/ux-collection-js:^1.0@alpha
composer require tienvx/ux-collection-js:^1.0@beta

# Don't forget to install the JavaScript dependencies as well and compile
yarn add --dev '@symfony/stimulus-bridge@^2.0.0'
Expand Down
2 changes: 1 addition & 1 deletion src/Resources/views/bootstrap_3_layout.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<div class="panel-heading" role="tab">
<a class="{{ form.vars.valid ? 'collapsed' }}" data-toggle="collapse" href="#{{ id }}-contents" aria-expanded="{{ form.vars.valid ? 'false' : 'true' }}">
<i class="fa fa-chevron-right collection-js-accordion-collapse-marker"></i>
{{ value|collection_js_as_string }}
{{ block('collection_js_accordion_label') }}
</a>
{{ block('collection_js_actions') }}
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/Resources/views/bootstrap_4_layout.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<div class="card-header">
<a class="{{ form.vars.valid ? 'collapsed' }}" data-toggle="collapse" href="#{{ id }}-contents" aria-expanded="{{ form.vars.valid ? 'false' : 'true' }}">
<i class="fa fa-chevron-right collection-js-accordion-collapse-marker"></i>
{{ value|collection_js_as_string }}
{{ block('collection_js_accordion_label') }}
</a>
{{ block('collection_js_actions') }}
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/Resources/views/bootstrap_5_layout.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<h2 class="accordion-header">
<button class="accordion-button {{ form.vars.valid ? 'collapsed' }}" type="button" data-bs-toggle="collapse" data-bs-target="#{{ id }}-contents">
<i class="fa fa-chevron-right collection-js-accordion-collapse-marker"></i>
{{ value|collection_js_as_string }}
{{ block('collection_js_accordion_label') }}
</button>
{{ block('collection_js_actions') }}
</h2>
Expand Down
4 changes: 4 additions & 0 deletions src/Resources/views/form_div_layout.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -90,3 +90,7 @@
{{ form_widget(form) }}
{% endif %}
{% endblock collection_js_accordion_item_body %}

{% block collection_js_accordion_label %}
<span class="collection-js-accordion-label">{{ value|collection_js_as_string }}</span>
{% endblock collection_js_accordion_label %}

0 comments on commit 2d0d313

Please sign in to comment.