move old alldocs stuff to advancedopts
Project: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/repo Commit: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/commit/02d25fef Tree: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/tree/02d25fef Diff: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/diff/02d25fef Branch: refs/heads/secondary-indexes Commit: 02d25fef2bea255b2dc45728e59f9cb010e3b02d Parents: 2e46f79 Author: Jenn Schiffer <[email protected]> Authored: Thu Jul 31 16:35:29 2014 -0400 Committer: deathbearbrown <[email protected]> Committed: Tue Aug 5 16:40:14 2014 -0400 ---------------------------------------------------------------------- app/addons/documents/routes.js | 2 +- app/addons/documents/views-advancedopts.js | 12 ++++++-- app/addons/documents/views.js | 39 ------------------------- 3 files changed, 11 insertions(+), 42 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/02d25fef/app/addons/documents/routes.js ---------------------------------------------------------------------- diff --git a/app/addons/documents/routes.js b/app/addons/documents/routes.js index 6361753..6bf2760 100644 --- a/app/addons/documents/routes.js +++ b/app/addons/documents/routes.js @@ -247,7 +247,7 @@ function(app, FauxtonAPI, Components, Documents, Changes, DocEditor, Databases, this.data.database.allDocs.paging.pageSize = this.getDocPerPageLimit(urlParams, parseInt(docParams.limit, 10)); - this.viewEditor = this.setView("#dashboard-upper-content", new Documents.Views.AllDocsLayout({ + this.viewEditor = this.setView("#dashboard-upper-content", new Documents.Views.AllDocsHeader({ database: this.data.database, collection: this.data.database.allDocs, params: urlParams, http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/02d25fef/app/addons/documents/views-advancedopts.js ---------------------------------------------------------------------- diff --git a/app/addons/documents/views-advancedopts.js b/app/addons/documents/views-advancedopts.js index b2e1af5..6cb515e 100644 --- a/app/addons/documents/views-advancedopts.js +++ b/app/addons/documents/views-advancedopts.js @@ -39,10 +39,11 @@ function(app, FauxtonAPI, resizeColumns ) { "change form.js-view-query-update input": "updateFilters", "change form.js-view-query-update select": "updateFilters", "submit form.js-view-query-update": "updateView", - "click .toggle-btns > label": "toggleQuery" + "click .toggle-btns > label": "toggleQueryKeys", + "click #toggle-query": "toggleQuery" }, - toggleQuery: function(e){ + toggleQueryKeys: function(e){ e.preventDefault(); if (this.$(e.currentTarget).hasClass("active")){ @@ -61,6 +62,12 @@ function(app, FauxtonAPI, resizeColumns ) { } }, + toggleQuery: function (event) { + console.log('togglequery'); + $('#dashboard-content').scrollTop(0); + this.$('#query-options').toggle(); + }, + showKeys: function(){ this.$("#js-showKeys, .js-disabled-message").show(); this.$('[name="startkey"],[name="endkey"],[name="inclusive_end"]').attr("disabled","true"); @@ -82,6 +89,7 @@ function(app, FauxtonAPI, resizeColumns ) { view.update(this.database, this.ddocName, this.viewName); }, this); } + }, renderOnUpdatehasReduce: function (hasReduce) { http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/02d25fef/app/addons/documents/views.js ---------------------------------------------------------------------- diff --git a/app/addons/documents/views.js b/app/addons/documents/views.js index 98e3f38..88a79c8 100644 --- a/app/addons/documents/views.js +++ b/app/addons/documents/views.js @@ -359,45 +359,6 @@ function(app, FauxtonAPI, Components, Documents, Databases, Views, QueryOptions, }); - Views.AllDocsLayout = FauxtonAPI.View.extend({ - template: "addons/documents/templates/all_docs_layout", - - initialize: function (options) { - this.database = options.database; - this.params = options.params; - }, - - events: { - 'click #toggle-query': "toggleQuery" - }, - - toggleQuery: function (event) { - $('#dashboard-content').scrollTop(0); - this.$('#query-options').toggle(); - }, - - beforeRender: function () { - this.advancedOptions = this.insertView('#toggle-query', new QueryOptions.AdvancedOptions({ - updateViewFn: this.updateAllDocs, - previewFn: this.previewView, - hasReduce: false, - showPreview: false, - database: this.database, - })); - - this.toolsView = this.setView(".js-search", new Views.JumpToDoc({ - database: this.database, - collection: this.database.allDocs - })); - }, - - afterRender: function () { - if (this.params) { - this.advancedOptions.updateFromParams(this.params); - } - } - - }); // TODO: Rename to reflect that this is a list of rows or documents Views.AllDocsList = FauxtonAPI.View.extend({
