summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsuelockwood <deathbear@apache.org>2014-03-11 11:50:57 -0400
committersuelockwood <deathbear@apache.org>2014-03-11 11:57:53 -0400
commit9e5f242cc1cee120bf265b1ae8eab1e760149ef1 (patch)
treeb744db30d1d502f456e628f5671a096e7bbae74e
parentfffc5b73d6714076b60ff5a2434d4bfaa8264183 (diff)
downloadcouchdb-2113-Fix-DB-search.tar.gz
Changed the typeahead to not make a call to _all_dbs and instead use the existing fetched collection.2113-Fix-DB-search
-rw-r--r--src/fauxton/app/addons/databases/views.js11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/fauxton/app/addons/databases/views.js b/src/fauxton/app/addons/databases/views.js
index a56267fbb..ef52b2f4f 100644
--- a/src/fauxton/app/addons/databases/views.js
+++ b/src/fauxton/app/addons/databases/views.js
@@ -124,15 +124,18 @@ function(app, Components, FauxtonAPI, Databases) {
},
afterRender: function() {
- var that = this;
- this.dbSearchTypeahead = new Components.DbSearchTypeahead({
- dbLimit: this.dbLimit,
+ var that = this,
+ AllDBsArray = _.map(this.collection.toJSON(), function(item, key){
+ return item.name;
+ });
+
+ this.dbSearchTypeahead = new Components.Typeahead({
el: "input.search-autocomplete",
+ source: AllDBsArray,
onUpdate: function (item) {
that.switchDatabase(null, item);
}
});
-
this.dbSearchTypeahead.render();
},