Skip to content

Commit

Permalink
fix: using href="#*" spamming browser history when switching translat…
Browse files Browse the repository at this point in the history
…ion tab (#390)
  • Loading branch information
karrakoliko authored Apr 9, 2024
1 parent bc599c5 commit 7c0a3a1
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions src/Resources/views/bootstrap_4_layout.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@
{% set locale = translationsFields.vars.name %}

<li class="nav-item">
<a href="#{{ translationsFields.vars.id }}_a2lix_translations-fields" class="nav-link {% if app.request.locale == locale %}active{% endif %}" data-toggle="tab" role="tab">
<div data-target="#{{ translationsFields.vars.id }}_a2lix_translations-fields" class="nav-link {% if app.request.locale == locale %}active{% endif %}" data-toggle="tab" role="tab">
{{ translationsFields.vars.label|default(locale|humanize)|trans }}
{% if form.vars.default_locale == locale %}{{ '[Default]'|trans }}{% endif %}
{% if translationsFields.vars.required %}*{% endif %}
</a>
</div>
</li>
{% endfor %}
</ul>
Expand Down
4 changes: 2 additions & 2 deletions src/Resources/views/bootstrap_5_layout.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@
{% set locale = translationsFields.vars.name %}

<li class="nav-item">
<a href="#{{ translationsFields.vars.id }}_a2lix_translations-fields" class="nav-link {% if app.request.locale == locale %}active{% endif %}" data-bs-toggle="tab" role="tab">
<div data-bs-target="#{{ translationsFields.vars.id }}_a2lix_translations-fields" class="nav-link {% if app.request.locale == locale %}active{% endif %}" data-bs-toggle="tab" role="tab">
{{ translationsFields.vars.label|default(locale|humanize)|trans }}
{% if form.vars.default_locale == locale %}{{ '[Default]'|trans }}{% endif %}
{% if translationsFields.vars.required %}*{% endif %}
</a>
</div>
</li>
{% endfor %}
</ul>
Expand Down
4 changes: 2 additions & 2 deletions src/Resources/views/macros_bootstrap_4.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ Example:
{% set locale = translationsFields.vars.name %}

<li class="nav-item">
<a href="#{{ translationsFields.vars.id }}_{{ fieldsNames|join('_') }}_a2lix_translations-fields" class="nav-link {% if app.request.locale == locale %}active{% endif %}" data-toggle="tab" role="tab">
<div data-target="#{{ translationsFields.vars.id }}_{{ fieldsNames|join('_') }}_a2lix_translations-fields" class="nav-link {% if app.request.locale == locale %}active{% endif %}" data-toggle="tab" role="tab">
{{ translationsFields.vars.label|default(locale|humanize)|trans }}
{% if form.vars.default_locale == locale %}{{ '[Default]'|trans }}{% endif %}
{% if translationsFields.vars.required %}*{% endif %}
</a>
</div>
</li>
{% endfor %}
</ul>
Expand Down
4 changes: 2 additions & 2 deletions src/Resources/views/macros_bootstrap_5.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ Example:
{% set locale = translationsFields.vars.name %}

<li class="nav-item">
<a href="#{{ translationsFields.vars.id }}_{{ fieldsNames|join('_') }}_a2lix_translations-fields" class="nav-link {% if app.request.locale == locale %}active{% endif %}" data-bs-toggle="tab" role="tab">
<div data-bs-target="#{{ translationsFields.vars.id }}_{{ fieldsNames|join('_') }}_a2lix_translations-fields" class="nav-link {% if app.request.locale == locale %}active{% endif %}" data-bs-toggle="tab" role="tab">
{{ translationsFields.vars.label|default(locale|humanize)|trans }}
{% if form.vars.default_locale == locale %}{{ '[Default]'|trans }}{% endif %}
{% if translationsFields.vars.required %}*{% endif %}
</a>
</div>
</li>
{% endfor %}
</ul>
Expand Down

0 comments on commit 7c0a3a1

Please sign in to comment.