Updated autocomplete to work in a more understandable way.
Change-Id: I2c4db0e90a46671eb83c7f8b829f57c11f98c323
diff --git a/client/catalog/catalog.js b/client/catalog/catalog.js
index faac685..691f8ed 100644
--- a/client/catalog/catalog.js
+++ b/client/catalog/catalog.js
@@ -174,7 +174,6 @@
}
Atmos.prototype.autoComplete = function(field, callback){
- console.log("Autocomplete triggered");
if (this.searchInput.val().length === 0 && !filters.hasOwnProperty()){
if (!this.searchBar.hasClass('has-error')){
@@ -192,13 +191,10 @@
var ack = data.getName();
- var name = new Name(scope.catalog).append('query-results').append(JSON.stringify(filters)).append(ack.get(-3)).append(ack.get(-2));
-
- console.log(name.toUri(), filters);
+ var name = new Name(scope.catalog).append('query-results').append(JSON.stringify({"?": field})).append(ack.get(-3)).append(ack.get(-2));
scope.face.expressInterest(new Interest(name).setInterestLifetimeMilliseconds(5000),
function(interest, data){
- console.log("Autocomplete query return: ", data.getContent().toString());
if (data.getContent().length !== 0){
var options = JSON.parse(data.getContent().toString().replace(/[\n\0]/g, "")).next.map(function(element){