You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@couchdb.apache.org by michellephung <gi...@git.apache.org> on 2015/10/16 23:17:16 UTC

[GitHub] couchdb-fauxton pull request: a table view for fauxton

Github user michellephung commented on a diff in the pull request:

    https://github.com/apache/couchdb-fauxton/pull/543#discussion_r42291221
  
    --- Diff: app/addons/components/react-components.react.jsx ---
    @@ -60,6 +62,94 @@ function (app, FauxtonAPI, React, Stores, FauxtonComponents, ace, beautifyHelper
         }
       });
     
    +
    +  var BulkActionComponent = React.createClass({
    +
    +    propTypes: {
    +      hasSelectedItem: React.PropTypes.bool.isRequired,
    +      removeItem: React.PropTypes.func.isRequired,
    +      selectAll: React.PropTypes.func.isRequired,
    +      toggleSelect: React.PropTypes.func.isRequired,
    +      isChecked: React.PropTypes.bool.isRequired
    +    },
    +
    +    getDefaultProps: function () {
    +      return {
    +        disabled: false,
    +        title: 'Select rows that can be...',
    +        bulkIcon: 'fonticon-trash',
    +        buttonTitle: 'Delete all selected',
    +        dropdownContentText: 'Deleted'
    +      };
    +    },
    +
    +    render: function () {
    +      return (
    +        <div className="bulk-action-component">
    +          <div className="bulk-action-component-selector-group">
    +            {this.getMasterSelector()}
    +            {this.getMultiSelectOptions()}
    +          </div>
    +        </div>
    +      );
    +    },
    +
    +    getMultiSelectOptions: function () {
    +      if (!this.props.hasSelectedItem) {
    +        return null;
    +      }
    +
    +      return (
    +        <div className="group-clean bulk-actions panel">
    +          <button
    +            onClick={this.props.removeItem}
    +            className={'fonticon ' + this.props.bulkIcon}
    +            title={this.props.buttonTitle} />
    +        </div>
    +      );
    +    },
    +
    +    getPopupContent: function () {
    +      return (
    +        <ul className="bulk-action-component-popover-actions">
    +          <li onClick={this.selectAll} >
    +            <i className="icon fonticon-cancel"></i> {this.props.dropdownContentText}
    +          </li>
    +        </ul>
    +      );
    +    },
    +
    +    selectAll: function () {
    +      this.refs.popover.hide();
    +      this.props.selectAll();
    +    },
    +
    +    getMasterSelector: function () {
    +      return (
    +        <div className="group-clean bulk-actions-panel panel">
    +          <input type="checkbox"
    +            checked={this.props.isChecked}
    +            onChange={this.props.toggleSelect}
    +            disabled={this.props.disabled} />
    +          <div className="separator"></div>
    +          <ReactBootstrap.OverlayTrigger
    +            ref='popover'
    --- End diff --
    
    thing


---
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.
---