From 39a014cfd46af27c6a5444eff025de18a39c2da8 Mon Sep 17 00:00:00 2001 From: artoscinote <85488244+artoscinote@users.noreply.github.com> Date: Wed, 16 Feb 2022 11:07:23 +0100 Subject: [PATCH] Fix red dot for active filters [SCI-6536] (#3861) --- app/javascript/packs/vue/repository_filter.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/app/javascript/packs/vue/repository_filter.js b/app/javascript/packs/vue/repository_filter.js index a30603b19..6bb1088fe 100644 --- a/app/javascript/packs/vue/repository_filter.js +++ b/app/javascript/packs/vue/repository_filter.js @@ -108,10 +108,14 @@ window.initRepositoryFilter = () => { .attr('data-repository-filter-json', JSON.stringify({ filter_elements: this.filtersJSON })); $('#repository_table_filter_elements_json').val(JSON.stringify(this.filtersJSON)); - $('#saveRepositoryFilters').removeClass('hidden'); + + if (this.filtersJSON.length > 0) { + $('#saveRepositoryFilters').removeClass('hidden'); + } + $('#filterContainer .dropdown-selector-container').removeClass('open'); $('#filtersDropdownButton').removeClass('open'); - $('#filtersDropdownButton').toggleClass('active-filters', this.filters.length > 0); + $('#filtersDropdownButton').toggleClass('active-filters', this.filtersJSON.length > 0); $('.repository-table-error').removeClass('active').html(''); this.reloadDataTable(); },