Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pf-accordion development #25

Closed
priley86 opened this issue Mar 9, 2017 · 2 comments
Closed

pf-accordion development #25

priley86 opened this issue Mar 9, 2017 · 2 comments

Comments

@priley86
Copy link
Contributor

priley86 commented Mar 9, 2017

We'd like to implement a pf-accordion and associated custom elements which have the same look and feel as our Accordion widget. The DOM API should look something like this:

 <pf-accordion id="myAccordion" role="tablist" aria-multiselectable="true">
  <pf-accordion-panel>
    <pf-accordion-heading role="tab" id="headingOne">
      <h4 class="panel-title">
        <a role="button" data-toggle="collapse" data-parent="#myAccordion" href="#collapseOne" aria-expanded="true" aria-controls="collapseOne">
          Collapsible Group Item #1
        </a>
      </h4>
    </pf-accordion-heading>
    <pf-accordion-template id="collapseOne" class="panel-collapse collapse in" role="tabpanel" aria-labelledby="headingOne">
      <pf-accordion-body>
        Collapse CONTENT 1
      </pf-accordion-body>
    </pf-accordion-template>
  </pf-accordion-panel>
  <pf-accordion-panel>
    <pf-accordion-heading role="tab" id="headingTwo">
      <h4 class="panel-title">
        <a class="collapsed" role="button" data-toggle="collapse" data-parent="#myAccordion" href="#collapseTwo" aria-expanded="false" aria-controls="collapseTwo">
          Collapsible Group Item #2
        </a>
      </h4>
    </pf-accordion-heading>
    <pf-accordion-template id="collapseTwo" class="panel-collapse collapse" role="tabpanel" aria-labelledby="headingTwo">
     <pf-accordion-body>
        Collapse CONTENT 2
      </pf-accordion-body>
    </pf-accordion-template>
  </pf-accordion-panel>
  <pf-accordion-panel>
    <pf-accordion-heading role="tab" id="headingThree">
      <h4 class="panel-title">
        <a class="collapsed" role="button" data-toggle="collapse" data-parent="#myAccordion" href="#collapseThree" aria-expanded="false" aria-controls="collapseThree">
          Collapsible Group Item #3
        </a>
      </h4>
    </pf-accordion-heading>
    <pf-accordion-template id="collapseThree" class="panel-collapse collapse" role="tabpanel" aria-labelledby="headingThree">
      <pf-accordion-body>
        Collapse CONTENT 3
      </pf-accordion-body>
    </pf-accordion-template>
  </pf-accordion-panel>
</pf-accordion>  

The JS API should mimic the Bootstrap Collapse API here.

@recrsn
Copy link
Contributor

recrsn commented Mar 13, 2017

Hi,
I have been writing this component since last week.

Does the a tag in the pf-accordion-header component must always have the data-toggle="collapse" etc ?

@priley86
Copy link
Contributor Author

It looks like the Bootstrap js is using data-toggle=collapse as a way of selecting any element which can trigger the collapse (so in some cases this may be a button or an a element)… this would be an easy way to select the trigger element and would be more consistent with Bootstrap JS… as always, i try to read the Bootstrap APIs closely when implementing a custom element and match as closely as possible. These examples may help too:
http://getbootstrap.com/javascript/#collapse
https://github.com/twbs/bootstrap/blob/v4-dev/js/src/collapse.js

@recrsn recrsn mentioned this issue Mar 13, 2017
9 tasks
recrsn added a commit to recrsn/patternfly-webcomponents that referenced this issue Apr 17, 2017
recrsn added a commit to recrsn/patternfly-webcomponents that referenced this issue Apr 19, 2017
recrsn added a commit to recrsn/patternfly-webcomponents that referenced this issue Apr 19, 2017
recrsn added a commit to recrsn/patternfly-webcomponents that referenced this issue Apr 29, 2017
recrsn added a commit to recrsn/patternfly-webcomponents that referenced this issue May 1, 2017
recrsn added a commit to recrsn/patternfly-webcomponents that referenced this issue May 2, 2017
recrsn added a commit to recrsn/patternfly-webcomponents that referenced this issue May 2, 2017
recrsn added a commit to recrsn/patternfly-webcomponents that referenced this issue May 5, 2017
recrsn added a commit to recrsn/patternfly-webcomponents that referenced this issue May 12, 2017
recrsn added a commit to recrsn/patternfly-webcomponents that referenced this issue May 15, 2017
recrsn added a commit to recrsn/patternfly-webcomponents that referenced this issue Jun 5, 2017
@cdcabrera cdcabrera self-assigned this Jun 13, 2017
recrsn added a commit to recrsn/patternfly-webcomponents that referenced this issue Jun 16, 2017
recrsn added a commit to recrsn/patternfly-webcomponents that referenced this issue Jul 5, 2017
recrsn added a commit to recrsn/patternfly-webcomponents that referenced this issue Jul 5, 2017
recrsn added a commit to recrsn/patternfly-webcomponents that referenced this issue Aug 15, 2017
recrsn added a commit to recrsn/patternfly-webcomponents that referenced this issue Aug 15, 2017
recrsn added a commit to recrsn/patternfly-webcomponents that referenced this issue Aug 15, 2017
recrsn added a commit to recrsn/patternfly-webcomponents that referenced this issue Aug 15, 2017
recrsn added a commit to recrsn/patternfly-webcomponents that referenced this issue Aug 15, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants