couchdb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From robertkowalski <...@git.apache.org>
Subject [GitHub] couchdb-fauxton pull request: Improvements to doc collapsed state
Date Thu, 22 Jan 2015 19:09:42 GMT
Github user robertkowalski commented on a diff in the pull request:

    https://github.com/apache/couchdb-fauxton/pull/230#discussion_r23400741
  
    --- Diff: app/addons/documents/views.js ---
    @@ -564,15 +591,79 @@ function(app, FauxtonAPI, Components, Documents, Databases, Views,
QueryOptions)
     
           this.toggleTrash();
           this.maybeHighlightAllButton();
    +      this.updateExpandButtonLabel();
         },
     
         perPage: function () {
           return this.allDocsNumber.perPage();
    +    },
    +
    +    // a bit dense, but necessary. It decides on what the Expand/Collapse button label
should be and takes into
    +    // account the default expand/collapse state, what rows are checked and their states
    +    updateExpandButtonLabel: function () {
    +
    +      if (this.defaultDocsStateExpanded) {
    +        this.setExpandButtonLabel(false);
    +
    +        // override the default label and show "Expand" if ALL checked rows have state
=== collapse (false)
    +        if (this.numSelectedOnPage() && this.allCheckedRowsHaveState(false))
{
    +          this.setExpandButtonLabel(true);
    +        }
    +      } else {
    +        this.setExpandButtonLabel(true); // default show "Expand"
    +
    +        // show "Collapse" if ALL checked rows have state === expanded (true)
    +        if (this.numSelectedOnPage() && this.allCheckedRowsHaveState(true)) {
    +          this.setExpandButtonLabel(false);
    +        }
    +      }
    +    },
    +
    +    setExpandButtonLabel: function(expanded) {
    +      if (expanded) {
    +        this.$('#collapse').html('<i class="icon-plus"></i> Expand');
    --- End diff --
    
    i mentioned you in https://github.com/robertkowalski/couchdb-fauxton/commit/d92f759960bbae0014b1f2b24fb9ec827ee05f3b
at several places to show you what is going to change


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

Mime
View raw message