]> source.dussan.org Git - archiva.git/commitdiff
avoid duplicate entries in the autocomplete search bix
authorOlivier Lamy <olamy@apache.org>
Mon, 27 Feb 2012 00:55:47 +0000 (00:55 +0000)
committerOlivier Lamy <olamy@apache.org>
Mon, 27 Feb 2012 00:55:47 +0000 (00:55 +0000)
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1293979 13f79535-47bb-0310-9956-ffa450edef68

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

index 97ea676d8112033be3ac4f9007943280907788fe..5ebea9d3afd087885b91d6801cf1a8551434f0d3 100644 (file)
@@ -194,7 +194,13 @@ $(function() {
              var res = $.map(data.artifact,function(item){
                return item.artifactId;
              });
-             response(res);
+             var uniqId = [];
+             for (var i= 0;i<res.length;i++){
+               if ( $.inArray(res[i],uniqId)<0){
+                 uniqId.push(res[i]);
+               }
+             }
+             response(uniqId);
            }
         );