Skip to content

Commit

Permalink
Add styling to active integrations filter (home-assistant#15164)
Browse files Browse the repository at this point in the history
Co-authored-by: Richard Leurs <[email protected]>
  • Loading branch information
NextNebula and NextNebula authored Oct 12, 2020
1 parent 1e3337d commit 887faf6
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
4 changes: 4 additions & 0 deletions sass/custom/_component_page.scss
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@
@media only screen and (min-width: $desk-start) {
#components-page {
.filter-button-group {
.active {
font-weight: bold;
}

.featured {
margin: 12px 0;
}
Expand Down
7 changes: 7 additions & 0 deletions source/integrations/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,13 @@

rendered = Mustache.render(template, data);

// set active class on active menu item
jQuery('.filter-button-group a.active').removeClass('active');
jQuery(`.filter-button-group a[href*="${hash}"]`).addClass('active');
if (hash === "") {
jQuery('.filter-button-group a[href*="#featured"]').addClass('active');
}

// remove previous elements and css classes, add the new stuff and then trigger the fade-in css animation
$('#componentContainer').html('').removeClass('show-items remove-items').html(rendered).addClass('show-items');
logoLazyLoad.update();
Expand Down

0 comments on commit 887faf6

Please sign in to comment.