Fixing bug in autocomplete.
Change-Id: I916368da098b2f4533f3d15a9a0f8a39b17ac5bc
diff --git a/client/catalog-dev/js/catalog.js b/client/catalog-dev/js/catalog.js
index 446a7c5..bdc9f54 100644
--- a/client/catalog-dev/js/catalog.js
+++ b/client/catalog-dev/js/catalog.js
@@ -96,9 +96,11 @@
//Init autocomplete
this.searchInput.autoComplete(function(field, callback){
ga('send', 'event', 'search', 'autocomplete');
- scope.autoComplete(field, function(list){
+ scope.autoComplete(field, function(data){
+ var list = data.next;
+ var last = data.lastComponent === true;
callback(list.map(function(element){
- return field + element + "/";
+ return field + element + (last?"/":""); //Don't add trailing slash for last component.
}));
});
});