Skip to content

Commit

Permalink
Fix issue where has_active_filters were not being looked up correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
anselmbradford committed Jan 17, 2019
1 parent 347a2d4 commit f0a1825
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -190,11 +190,13 @@

fragment_id: A unique ID for the filter list control.

has_active_filters: Whether the filter has active filters or not.

========================================================================== #}
{% macro render(value, form, fragment_id) %}
{% macro render(value, form, fragment_id, has_active_filters) %}
{% from 'organisms/expandable.html' import expandable with context %}
<div id="{{ fragment_id }}" class="o-filterable-list-controls">
{% if value.has_active_filters %}
{% if has_active_filters %}
{% do value.update({'is_expanded':true}) %}
{% endif %}

Expand Down
7 changes: 6 additions & 1 deletion cfgov/jinja2/v1/_includes/organisms/filterable-list.html
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,12 @@
{# ADD THE FILTER CONTROLS. #}

{% set fragment_id = 'o-filterable-list-controls' %}
{{ filterable_list_controls.render(value, form, fragment_id) }}
{{ filterable_list_controls.render(
value,
form,
fragment_id,
has_active_filters)
}}

{# ADD THE NOTIFICATION, IF NEEDED. #}

Expand Down

0 comments on commit f0a1825

Please sign in to comment.