mirror of
https://github.com/home-assistant/home-assistant.io.git
synced 2025-07-23 17:27:19 +00:00
Components: Hide non-featured component on page load
This commit is contained in:
parent
e93682035f
commit
9b20f0523a
@ -36,7 +36,9 @@ Support for these components is provided by the Home Assistant community.
|
||||
<div id="componentContainer">
|
||||
{% for component in components %}
|
||||
{% if component.ha_category %}
|
||||
<a href='{{ component.url }}' class='{{ component.ha_category | slugify }}{% if component.featured %} featured{% endif %}'>
|
||||
<a href='{{ component.url }}'
|
||||
class='{{ component.ha_category | slugify }}{% if component.featured %} featured{% endif %}'
|
||||
{% unless component.featured %}style='display: none'{% endunless %}>
|
||||
<div class='img-container'>
|
||||
{% if component.logo %}
|
||||
<img src='/images/supported_brands/{{ component.logo }}'>
|
||||
@ -60,8 +62,19 @@ Support for these components is provided by the Home Assistant community.
|
||||
{% endcomment %}
|
||||
|
||||
<script src="https://code.jquery.com/jquery-2.1.4.min.js"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery.isotope/2.2.2/isotope.pkgd.js"></script>
|
||||
<script type="text/javascript">
|
||||
<script>
|
||||
// undo initial hiding of non-featured cards
|
||||
if (location.hash !== '') {
|
||||
if (location.hash === '#all') {
|
||||
jQuery('#componentContainer a').show();
|
||||
} else {
|
||||
jQuery('#componentContainer .featured').hide();
|
||||
jQuery('#componentContainer .' + location.hash.substr(1)).show();
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery.isotope/2.2.2/isotope.pkgd.min.js"></script>
|
||||
<script>
|
||||
$(window).load(function(){
|
||||
var $container = $('#componentContainer');
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user