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 02DA717AF0 for ; Tue, 24 Mar 2015 15:56:55 +0000 (UTC) Received: (qmail 88147 invoked by uid 500); 24 Mar 2015 15:56:54 -0000 Delivered-To: apmail-couchdb-dev-archive@couchdb.apache.org Received: (qmail 88091 invoked by uid 500); 24 Mar 2015 15:56:54 -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 88080 invoked by uid 99); 24 Mar 2015 15:56:54 -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; Tue, 24 Mar 2015 15:56:54 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 5287FE05E1; Tue, 24 Mar 2015 15:56:54 +0000 (UTC) From: benkeen To: dev@couchdb.apache.org Reply-To: dev@couchdb.apache.org References: In-Reply-To: Subject: [GitHub] couchdb-fauxton pull request: React docs list Content-Type: text/plain Message-Id: <20150324155654.5287FE05E1@git1-us-west.apache.org> Date: Tue, 24 Mar 2015 15:56:54 +0000 (UTC) Github user benkeen commented on a diff in the pull request: https://github.com/apache/couchdb-fauxton/pull/324#discussion_r27041796 --- Diff: app/addons/documents/index-results/index-results.components.react.jsx --- @@ -28,10 +36,118 @@ function (app, FauxtonAPI, React) { } }); + var ResultsScreen = React.createClass({ + + onDoubleClick: function (id, doc) { + FauxtonAPI.navigate(doc.url); + }, + + getUrlFragment: function (url) { + if (this.props.hasReduce) { + return null; + } + + + return ( + + + ); + }, + + getDocumentList: function () { + return _.map(this.props.results, function (doc) { + return ( + + {this.getUrlFragment('#' + doc.url)} + + ); + }, this); + }, + + render: function () { + var classNames = 'view'; + + if (this.props.isDeleteable) { + classNames += ' show-select'; + } + + return ( +
+
+ + {this.getDocumentList()} + +
+
+ ); + }, + + componentDidMount: function () { + prettyPrint(); + }, + + componentDidUpdate: function () { + prettyPrint(); + }, + + }); + var ViewResultListController = React.createClass({ + getStoreState: function () { + return { + hasResults: store.hasResults(), + results: store.getResults(), + isDeleteable: store.isDeleteable(), + isSelected: store.isSelected, + hasReduce: store.hasReduce() + }; + }, + + isSelected: function (id) { + return this.state.isSelected(id); + }, + + getInitialState: function () { + return this.getStoreState(); + }, + + componentDidMount: function() { --- End diff -- space after function, same for next function --- 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. ---