]> source.dussan.org Git - archiva.git/commitdiff
fix filtering
authorOlivier Lamy <olamy@apache.org>
Wed, 15 Jan 2014 04:03:57 +0000 (04:03 +0000)
committerOlivier Lamy <olamy@apache.org>
Wed, 15 Jan 2014 04:03:57 +0000 (04:03 +0000)
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1558291 13f79535-47bb-0310-9956-ffa450edef68

archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/archiva/search.js

index b529814d7410e84768449f02ce51fdb2f786db30..756434a8dc0fd4d2c67d8103bf0d282fc38a5ad5 100644 (file)
@@ -1423,7 +1423,7 @@ define("archiva.search",["jquery","jquery.ui","i18n","jquery.tmpl","select2","kn
   }
 
   enableAutocompleBrowse=function(groupId){
-    $.log("enableAutocompleBrowse");
+    $.log("enableAutocompleBrowse with groupId:'"+groupId+"'");
     $("#select_browse_repository" ).select2({width: "resolve"});
     // browse-autocomplete
     var url="restServices/archivaServices/browseService/rootGroups";
@@ -1441,9 +1441,9 @@ define("archiva.search",["jquery","jquery.ui","i18n","jquery.tmpl","select2","kn
         {
           name: 'browse-result',
           remote: {
-            url: groupId?url+'/%QUERY':url,
+            url: url,//groupId?url+'/%QUERY':url,
             beforeSend: function(jqXhr){
-              $.log("beforeSend");
+              $.log("beforeSend browseBox.val():'"+browseBox.val()+"'");
             },
             filter: function(parsedResponse){
               var request = browseBox.val();
@@ -1492,10 +1492,12 @@ define("archiva.search",["jquery","jquery.ui","i18n","jquery.tmpl","select2","kn
                       result=browseResultEntries;
                     }
                     var filtered = [];
+                    $.log("filtering with request '"+request+"'");
                     for(var i=0;i<browseResultEntries.length;i++){
                       if (groupId){
                         if (browseResultEntries[i].name.startsWith(groupId+'.'+request)){
-                          filtered.push(browseResultEntries[i]);
+                          var item = browseResultEntries[i];
+                          filtered.push(item.name.substring(groupId.length+1, item.name.length));
                         }
                       } else {
                         if (browseResultEntries[i].name.startsWith(request)){