Skip to content

Commit

Permalink
Temporary change to open filter on licence finder pages
Browse files Browse the repository at this point in the history
  • Loading branch information
jon-kirwan committed May 18, 2023
1 parent 48bac7d commit f21b5fb
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
4 changes: 4 additions & 0 deletions app/assets/javascripts/modules/mobile-filters-modal.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ window.GOVUK.Modules = window.GOVUK.Modules || {};
this.triggerElement.addEventListener('click', this.module.toggle)
this.triggerElement.setAttribute('aria-controls', this.module.id)
this.triggerElement.setAttribute('aria-expanded', 'false')

if(this.triggerElement.dataset.documentNoun === 'report') {
this.triggerElement.click()
}
}

if (this.clearFiltersTrigger) {
Expand Down
1 change: 1 addition & 0 deletions app/views/finders/_filter_button.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
data-target="facet-wrapper"
data-track-category="filterClicked"
data-track-action="mobile-filter-button"
data-document-noun="<%= @content_item.document_noun %>"
data-track-label="">
Filter <span class="govuk-visually-hidden"> results</span>
<span class="js-selected-filter-count"><%= sanitize facet_tags.display_total_selected_filters %></span>
Expand Down

0 comments on commit f21b5fb

Please sign in to comment.