Skip to content

Commit

Permalink
fix: using href="#*" spams browser history
Browse files Browse the repository at this point in the history
  • Loading branch information
karrakoliko committed Apr 8, 2024
1 parent bc599c5 commit 86ccc51
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 14 deletions.
4 changes: 2 additions & 2 deletions src/Resources/views/bootstrap_3_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{% if app.request.locale == locale %} class="active"{% endif %}>
<a href="#{{ translationsFields.vars.id }}_a2lix_translations-fields" data-toggle="tab" role="tab">
<div data-bs-target="#{{ translationsFields.vars.id }}_a2lix_translations-fields" 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_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-bs-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.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,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-bs-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_3.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{% if app.request.locale == locale %} class="active"{% endif %}>
<a href="#{{ translationsFields.vars.id }}_{{ fieldsNames|join('_') }}_a2lix_translations-fields" data-toggle="tab" role="tab">
<div data-bs-target="#{{ translationsFields.vars.id }}_{{ fieldsNames|join('_') }}_a2lix_translations-fields" 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_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-bs-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 86ccc51

Please sign in to comment.