Return-Path: X-Original-To: apmail-couchdb-dev-archive@www.apache.org Delivered-To: apmail-couchdb-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 1869510279 for ; Thu, 22 Jan 2015 18:40:28 +0000 (UTC) Received: (qmail 74223 invoked by uid 500); 22 Jan 2015 18:40:27 -0000 Delivered-To: apmail-couchdb-dev-archive@couchdb.apache.org Received: (qmail 74161 invoked by uid 500); 22 Jan 2015 18:40:27 -0000 Mailing-List: contact dev-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 dev@couchdb.apache.org Received: (qmail 74150 invoked by uid 99); 22 Jan 2015 18:40:27 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 22 Jan 2015 18:40:27 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id CDA48E03A3; Thu, 22 Jan 2015 18:40:25 +0000 (UTC) From: robertkowalski To: dev@couchdb.apache.org Reply-To: dev@couchdb.apache.org References: In-Reply-To: Subject: [GitHub] couchdb-fauxton pull request: Improvements to doc collapsed state Content-Type: text/plain Message-Id: <20150122184025.CDA48E03A3@git1-us-west.apache.org> Date: Thu, 22 Jan 2015 18:40:25 +0000 (UTC) Github user robertkowalski commented on a diff in the pull request: https://github.com/apache/couchdb-fauxton/pull/230#discussion_r23398246 --- Diff: app/addons/documents/views.js --- @@ -505,21 +516,37 @@ function(app, FauxtonAPI, Components, Documents, Databases, Views, QueryOptions) }, beforeRender: function() { - var docs; - this.removeNestedViews(); this.pagination.setCollection(this.collection); this.allDocsNumber.setCollection(this.collection); - docs = this.expandDocs ? this.collection : this.collection.simple(); + // on new page loads, the doc models don't have their state defined + var isNewPage = true; + var allSelected = false; + if (this.collection.length) { + var firstItem = this.collection.first(); + isNewPage = _.isUndefined(firstItem.get('expanded')); + if (this.numSelectedOnPage() === this.collection.length) { + allSelected = true; + } + } - docs.each(function(doc) { + this.collection.each(function(doc) { --- End diff -- space missing :space_invader: --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastructure@apache.org or file a JIRA ticket with INFRA. ---