From e257441e6ebe12b94d59c39404d8501392e6ad0c Mon Sep 17 00:00:00 2001 From: Olivier Lamy Date: Wed, 29 Feb 2012 18:52:02 +0000 Subject: [PATCH] add a button to restore original search results after have applying some filtering git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1295215 13f79535-47bb-0310-9956-ffa450edef68 --- .../archiva-webapp-js/src/main/webapp/js/archiva/search.js | 6 +++++- .../src/main/webapp/js/archiva/templates/search.html | 2 ++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/search.js b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/search.js index bdf45ee41..90a1f9c7c 100644 --- a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/search.js +++ b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/search.js @@ -724,7 +724,9 @@ $(function() { advancedSearch=function(){ self.search("restServices/archivaServices/searchService/searchArtifacts"); } - + removeFilter=function(){ + self.resultViewModel.artifacts(self.resultViewModel.originalArtifacts); + } this.search=function(url){ var mainContent=$("#main-content"); @@ -756,11 +758,13 @@ $(function() { displayWarningMessage( $.i18n.prop("search.artifact.noresults")); return; } else { + self.resultViewModel.originalArtifacts=artifacts; self.resultViewModel.artifacts(artifacts); if (!searchResultsGrid.attr("data-bind")){ searchResultsGrid.attr("data-bind", "simpleGrid: gridViewModel,simpleGridTemplate:'search-results-view-grid-tmpl',pageLinksId:'search-results-view-grid-pagination'"); ko.applyBindings(self.resultViewModel,searchResultsGrid.get(0)); + ko.applyBindings(self,mainContent.find("#remove-filter-id" ).get(0)); } activateSearchResultsTab(); diff --git a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/templates/search.html b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/templates/search.html index 4c1b98637..e24694035 100644 --- a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/templates/search.html +++ b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/templates/search.html @@ -267,6 +267,8 @@
+ remove filter +
-- 2.39.5