mirror of
https://github.com/home-assistant/home-assistant.io.git
synced 2025-07-22 00:36:49 +00:00
Scroll to top when selecting category (#18072)
This commit is contained in:
parent
2f9169e6f0
commit
aed1255866
@ -47,11 +47,11 @@ regenerate: false
|
|||||||
{%- for category in categories -%}
|
{%- for category in categories -%}
|
||||||
{%- assign components_count = components | where: 'ha_category', category | size -%}
|
{%- assign components_count = components | where: 'ha_category', category | size -%}
|
||||||
{%- if category and category != 'Other' and components_count != 0 -%}
|
{%- if category and category != 'Other' and components_count != 0 -%}
|
||||||
<a href='#{{ category | slugify }}' class="btn">{{ category }} ({{ components_count }})</a>
|
<a href='#{{ category | slugify }}' class="btn" onclick="document.querySelector('.page-content').scrollTop = 0">{{ category }} ({{ components_count }})</a>
|
||||||
{%- endif -%}
|
{%- endif -%}
|
||||||
{%- endfor -%}
|
{%- endfor -%}
|
||||||
|
|
||||||
<a href='#other' class="btn">Other ({{ components | where: 'ha_category', 'Other' | size }})</a>
|
<a href='#other' class="btn" onclick="document.querySelector('.page-content').scrollTop = 0">Other ({{ components | where: 'ha_category', 'Other' | size }})</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="grid__item five-sixths lap-one-whole palm-one-whole">
|
<div class="grid__item five-sixths lap-one-whole palm-one-whole">
|
||||||
|
Loading…
x
Reference in New Issue
Block a user