Return-Path: X-Original-To: apmail-couchdb-commits-archive@www.apache.org Delivered-To: apmail-couchdb-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 6375D1150E for ; Wed, 13 Aug 2014 16:51:09 +0000 (UTC) Received: (qmail 2999 invoked by uid 500); 13 Aug 2014 16:51:09 -0000 Delivered-To: apmail-couchdb-commits-archive@couchdb.apache.org Received: (qmail 2951 invoked by uid 500); 13 Aug 2014 16:51:09 -0000 Mailing-List: contact commits-help@couchdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@couchdb.apache.org Delivered-To: mailing list commits@couchdb.apache.org Received: (qmail 2941 invoked by uid 99); 13 Aug 2014 16:51:09 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 13 Aug 2014 16:51:09 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id D316D9A585F; Wed, 13 Aug 2014 16:51:08 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: deathbear@apache.org To: commits@couchdb.apache.org Message-Id: <59cb7d605bea4171889991f3d51c6eb2@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: fauxton commit: updated refs/heads/secondary-indexes to 17fd138 Date: Wed, 13 Aug 2014 16:51:08 +0000 (UTC) Repository: couchdb-fauxton Updated Branches: refs/heads/secondary-indexes e6f79cc2f -> 17fd138c4 Change the all docs select header to be it's own view Project: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/repo Commit: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/commit/17fd138c Tree: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/tree/17fd138c Diff: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/diff/17fd138c Branch: refs/heads/secondary-indexes Commit: 17fd138c4d50a8ef04ad587cdc29d8bf0547195b Parents: e6f79cc Author: deathbearbrown Authored: Wed Aug 13 12:51:10 2014 -0400 Committer: deathbearbrown Committed: Wed Aug 13 12:51:10 2014 -0400 ---------------------------------------------------------------------- app/addons/documents/routes.js | 25 ++++++++--- .../documents/templates/header_alldocs.html | 2 - .../documents/templates/select-doc-menu.html | 25 ++++++----- app/addons/documents/views.js | 44 ++++++-------------- 4 files changed, 47 insertions(+), 49 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/17fd138c/app/addons/documents/routes.js ---------------------------------------------------------------------- diff --git a/app/addons/documents/routes.js b/app/addons/documents/routes.js index 911b04f..fb9bcc0 100644 --- a/app/addons/documents/routes.js +++ b/app/addons/documents/routes.js @@ -158,7 +158,8 @@ function(app, FauxtonAPI, Components, Documents, Changes, DocEditor, Databases, "route:paginate": "paginate", "route:perPageChange": "perPageChange", "route:changesFilterAdd": "addFilter", - "route:changesFilterRemove": "removeFilter" + "route:changesFilterRemove": "removeFilter", + "route:toggleSelectHeader": "toggleSelectheader" }, initialize: function (route, masterLayout, options) { @@ -202,7 +203,7 @@ function(app, FauxtonAPI, Components, Documents, Changes, DocEditor, Databases, Show right header for all docs that includes: query options, api bar, search and select ----------------------------------------------------*/ - this.changesHeader = true; + this.allDocsHeader = false; this.resetAllDocsHeader(); /* -------------------------------------------------- @@ -263,12 +264,26 @@ function(app, FauxtonAPI, Components, Documents, Changes, DocEditor, Databases, }, + toggleSelectheader: function(){ + /* -------------------------------------------------- + Set up right header for the document select menu + or reset back to all docs header + ----------------------------------------------------*/ + if (this.allDocsHeader){ + this.allDocsHeader = false; + this.rightHeader = this.setView("#api-navbar", new Documents.Views.SelectMenuHeader({})); + this.rightHeader.forceRender(); + } else { + this.resetAllDocsHeader(); + } + + }, resetAllDocsHeader: function(){ - if (this.changesHeader){ + if (!this.allDocsHeader){ this.rightHeader = this.setView("#api-navbar", new Documents.Views.RightAllDocsHeader({ database: this.data.database })); - this.changesHeader = false; + this.allDocsHeader = true; } }, @@ -502,7 +517,7 @@ function(app, FauxtonAPI, Components, Documents, Changes, DocEditor, Databases, documentation: this.data.database.documentation() })); - this.changesHeader = true; + this.allDocsHeader = true; /* -------------------------------------------------- Set sidebar highlight http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/17fd138c/app/addons/documents/templates/header_alldocs.html ---------------------------------------------------------------------- diff --git a/app/addons/documents/templates/header_alldocs.html b/app/addons/documents/templates/header_alldocs.html index 36d62f8..ff6d8a8 100644 --- a/app/addons/documents/templates/header_alldocs.html +++ b/app/addons/documents/templates/header_alldocs.html @@ -26,8 +26,6 @@ the License. -
-
Select
http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/17fd138c/app/addons/documents/templates/select-doc-menu.html ---------------------------------------------------------------------- diff --git a/app/addons/documents/templates/select-doc-menu.html b/app/addons/documents/templates/select-doc-menu.html index bad70a7..a00c851 100644 --- a/app/addons/documents/templates/select-doc-menu.html +++ b/app/addons/documents/templates/select-doc-menu.html @@ -11,14 +11,19 @@ WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. --> -
-
- - - <% if (expandDocs) { %> - - <% } else { %> - - <% } %> -
+ + +
+ Select
+ + + + + +<% if (expandDocs) { %> + +<% } else { %> + +<% } %> + http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/17fd138c/app/addons/documents/views.js ---------------------------------------------------------------------- diff --git a/app/addons/documents/views.js b/app/addons/documents/views.js index 148ee60..d0e5142 100644 --- a/app/addons/documents/views.js +++ b/app/addons/documents/views.js @@ -56,36 +56,8 @@ function(app, FauxtonAPI, Components, Documents, Databases, Views, QueryOptions, }, selectAllMenu: function(e){ - //trigger event to select all in other view - this.$('.toggle-select-menu').toggleClass('active'); - - //trigger event to change the header - this.toggleSelectMenu(); + FauxtonAPI.triggerRouteEvent("toggleSelectHeader"); FauxtonAPI.Events.trigger("documents:show-select-all",this.selectVisible); - - }, - - toggleSelectMenu: function(){ - if (this.selectVisible){ - this.selectVisible = false; - this.selectMenu.remove(); - this.addAllDocsMenu(); - } else { - this.removeAllDocsMenu(); - this.addSelectMenu(); - } - }, - - addSelectMenu: function(){ - this.selectVisible = true; - this.selectMenu = this.insertView('#header-select-menu', new Views.SelectMenu({})); - this.selectMenu.render(); - }, - - removeAllDocsMenu: function(){ - this.headerSearch.remove(); - this.queryOptions.remove(); - this.apiBar.remove(); }, addAllDocsMenu: function(){ @@ -188,13 +160,21 @@ function(app, FauxtonAPI, Components, Documents, Databases, Views, QueryOptions, }); // select docs header - Views.SelectMenu = FauxtonAPI.View.extend({ + Views.SelectMenuHeader = FauxtonAPI.View.extend({ + className: "header-right", template:"addons/documents/templates/select-doc-menu", events: { "click button.all": "selectAll", "click button.js-bulk-delete": "bulkDelete", - "click #collapse": "collapse" + "click #collapse": "collapse", + 'click .toggle-select-menu': 'selectAllMenu' + }, + + selectAllMenu: function(e){ + FauxtonAPI.triggerRouteEvent("toggleSelectHeader"); + FauxtonAPI.Events.trigger("documents:show-select-all",this.selectVisible); }, + bulkDelete: function(){ FauxtonAPI.Events.trigger("documents:bulkDelete"); }, @@ -258,7 +238,7 @@ function(app, FauxtonAPI, Components, Documents, Databases, Views, QueryOptions, Views.Document = FauxtonAPI.View.extend({ template: "addons/documents/templates/all_docs_item", className: function(){ - return (this.showSelect? "showSelect":"") + " all-docs-item doc-row" + return (this.showSelect? "showSelect":"") + " all-docs-item doc-row"; }, initialize: function (options) { this.checked = options.checked;