Skip to content

Commit

Permalink
Merge 1034cca into dcdfd95
Browse files Browse the repository at this point in the history
  • Loading branch information
njkim committed Sep 16, 2020
2 parents dcdfd95 + 1034cca commit 0de9c03
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 6 deletions.
Expand Up @@ -137,6 +137,10 @@ define([
}
}, this);
}
},

clear: function() {
this.filter.facets.removeAll();
}
}),
template: { require: 'text!templates/views/components/search/advanced-search.htm' }
Expand Down
10 changes: 10 additions & 0 deletions arches/app/media/js/views/search.js
Expand Up @@ -67,6 +67,16 @@ define([
}
}, this);
};
this.filterApplied = ko.pureComputed(function(){
var notFilters = ['paging-filter', 'related-resources-filter', 'saved-searches', 'search-export', 'search-result-details', 'search-results'];
var trueFilters = Object.keys(this.filters).filter(function(f){
return notFilters.indexOf(f) === -1;
});
var res = trueFilters.filter(function(f){
return this.query()[f];
}, this);
return res.length > 0;
}, this);
this.mouseoverInstanceId = ko.observable();
this.mapLinkData = ko.observable(null);
this.userIsReviewer = ko.observable(false);
Expand Down
7 changes: 1 addition & 6 deletions arches/app/templates/views/search.htm
Expand Up @@ -55,12 +55,7 @@
<!-- Title Block -->
<div class="search-count-container">
<h3 class="search-title" data-bind="text: '{% trans 'Results: ' %}' + total()"></h3>
<!--ko if:
sharedStateObject.query()['term-filter'] ||
sharedStateObject.query()['map-filter'] ||
sharedStateObject.query()['resource-type-filter'] ||
sharedStateObject.query()['time-filter']
-->
<!--ko if: sharedStateObject.filterApplied() -->
<button class="btn-sm btn btn-mint btn-labeled" style="padding: 2px 9px;" data-bind="click: function() {sharedStateObject.clearQuery();}">{% trans "Clear Filters" %}</button>
<!--/ko-->
</div>
Expand Down

0 comments on commit 0de9c03

Please sign in to comment.