mirror of https://github.com/apache/archiva.git
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
This commit is contained in:
parent
3ec57c570a
commit
e257441e6e
|
@ -724,7 +724,9 @@ $(function() {
|
||||||
advancedSearch=function(){
|
advancedSearch=function(){
|
||||||
self.search("restServices/archivaServices/searchService/searchArtifacts");
|
self.search("restServices/archivaServices/searchService/searchArtifacts");
|
||||||
}
|
}
|
||||||
|
removeFilter=function(){
|
||||||
|
self.resultViewModel.artifacts(self.resultViewModel.originalArtifacts);
|
||||||
|
}
|
||||||
this.search=function(url){
|
this.search=function(url){
|
||||||
|
|
||||||
var mainContent=$("#main-content");
|
var mainContent=$("#main-content");
|
||||||
|
@ -756,11 +758,13 @@ $(function() {
|
||||||
displayWarningMessage( $.i18n.prop("search.artifact.noresults"));
|
displayWarningMessage( $.i18n.prop("search.artifact.noresults"));
|
||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
|
self.resultViewModel.originalArtifacts=artifacts;
|
||||||
self.resultViewModel.artifacts(artifacts);
|
self.resultViewModel.artifacts(artifacts);
|
||||||
if (!searchResultsGrid.attr("data-bind")){
|
if (!searchResultsGrid.attr("data-bind")){
|
||||||
searchResultsGrid.attr("data-bind",
|
searchResultsGrid.attr("data-bind",
|
||||||
"simpleGrid: gridViewModel,simpleGridTemplate:'search-results-view-grid-tmpl',pageLinksId:'search-results-view-grid-pagination'");
|
"simpleGrid: gridViewModel,simpleGridTemplate:'search-results-view-grid-tmpl',pageLinksId:'search-results-view-grid-pagination'");
|
||||||
ko.applyBindings(self.resultViewModel,searchResultsGrid.get(0));
|
ko.applyBindings(self.resultViewModel,searchResultsGrid.get(0));
|
||||||
|
ko.applyBindings(self,mainContent.find("#remove-filter-id" ).get(0));
|
||||||
}
|
}
|
||||||
|
|
||||||
activateSearchResultsTab();
|
activateSearchResultsTab();
|
||||||
|
|
|
@ -267,6 +267,8 @@
|
||||||
|
|
||||||
|
|
||||||
<div id="search-results" class="tab-pane">
|
<div id="search-results" class="tab-pane">
|
||||||
|
<a href="#" class="btn btn-warning" data-bind="click: removeFilter" id="remove-filter-id">remove filter</a>
|
||||||
|
|
||||||
<table class="table table-striped table-bordered" id="search-results-grid">
|
<table class="table table-striped table-bordered" id="search-results-grid">
|
||||||
</table>
|
</table>
|
||||||
<div id="search-results-view-grid-pagination"></div>
|
<div id="search-results-view-grid-pagination"></div>
|
||||||
|
|
Loading…
Reference in New Issue