diff options
author | suelockwood <deathbear@apache.org> | 2014-01-09 10:15:33 -0500 |
---|---|---|
committer | suelockwood <deathbear@apache.org> | 2014-01-09 10:15:33 -0500 |
commit | 65c1b9993c0108e09e3b32303dc3b9bf69573ff6 (patch) | |
tree | 222deaeb37541ac83d6423b1f0e94f9e6d0523ee | |
parent | b9a87c875ef0eef2f920781805d26b0dd14e7871 (diff) | |
download | couchdb-65c1b9993c0108e09e3b32303dc3b9bf69573ff6.tar.gz |
Fix sidebar for new views that have odd characters
-rw-r--r-- | src/fauxton/app/modules/documents/views.js | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/src/fauxton/app/modules/documents/views.js b/src/fauxton/app/modules/documents/views.js index 05c86f834..c3f96b702 100644 --- a/src/fauxton/app/modules/documents/views.js +++ b/src/fauxton/app/modules/documents/views.js @@ -1535,7 +1535,8 @@ function(app, FauxtonAPI, Components, Documents, Databases, pouchdb, resizeColum } this.ddocID = this.model.id; } else { - this.model = this.ddocs.get(this.ddocID).dDocModel(); + var ddocDecode = decodeURIComponent(this.ddocID); + this.model = this.ddocs.get(ddocDecode).dDocModel(); this.reduceFunStr = this.model.viewHasReduce(this.viewName); this.setView('#ddoc-info', new Views.DdocInfo({model: this.ddocInfo })); } @@ -1717,10 +1718,26 @@ function(app, FauxtonAPI, Components, Documents, Databases, pouchdb, resizeColum }, this); }, + addNewSidebarItem: function(key, selector, design){ + console.log(args, "sidebarupdate"); + // var selected = this.ddocID == "_design/"+design; + // var view = this.insertView("ul.nav.views", new Views.IndexItem({ + // ddoc: design, + // index: key, + // database: this.collection.database.id, + // selected: selected && key == this.currView + // })); + // if (render !== false) { + // view.render(); + // } + }, + afterRender: function () { if (this.selectedTab) { this.setSelectedTab(this.selectedTab); } + + this.listenTo(this.collection, "add", this.addNewSidebarItem); }, setSelectedTab: function (selectedTab) { |