Skip to content
Permalink
Browse files

Accordion: Removed requirement for headers contain a child (and remov…

…ed associated ui-accordion-heading class).
  • Loading branch information...
scottgonzalez committed Feb 27, 2012
1 parent 4da7ec3 commit 02855292f2746d2c6f64a729730727df6684c6c7
@@ -22,15 +22,15 @@
<div class="demo">

<div id="accordion">
<h3><a href="#">Section 1</a></h3>
<h3>Section 1</h3>
<div>
<p>Mauris mauris ante, blandit et, ultrices a, suscipit eget, quam. Integer ut neque. Vivamus nisi metus, molestie vel, gravida in, condimentum sit amet, nunc. Nam a nibh. Donec suscipit eros. Nam mi. Proin viverra leo ut odio. Curabitur malesuada. Vestibulum a velit eu ante scelerisque vulputate.</p>
</div>
<h3><a href="#">Section 2</a></h3>
<h3>Section 2</h3>
<div>
<p>Sed non urna. Donec et ante. Phasellus eu ligula. Vestibulum sit amet purus. Vivamus hendrerit, dolor at aliquet laoreet, mauris turpis porttitor velit, faucibus interdum tellus libero ac justo. Vivamus non quam. In suscipit faucibus urna. </p>
</div>
<h3><a href="#">Section 3</a></h3>
<h3>Section 3</h3>
<div>
<p>Nam enim risus, molestie et, porta ac, aliquam ac, risus. Quisque lobortis. Phasellus pellentesque purus in massa. Aenean in pede. Phasellus ac libero ac tellus pellentesque semper. Sed ac felis. Sed commodo, magna quis lacinia ornare, quam ante aliquam nisi, eu iaculis leo purus venenatis dui. </p>
<ul>
@@ -39,7 +39,7 @@ <h3><a href="#">Section 3</a></h3>
<li>List item three</li>
</ul>
</div>
<h3><a href="#">Section 4</a></h3>
<h3>Section 4</h3>
<div>
<p>Cras dictum. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Aenean lacinia mauris vel est. </p><p>Suspendisse eu nisl. Nullam ut libero. Integer dignissim consequat lectus. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. </p>
</div>
@@ -32,15 +32,15 @@
<div class="demo">

<div id="accordion">
<h3><a href="#">Section 1</a></h3>
<h3>Section 1</h3>
<div>
<p>Mauris mauris ante, blandit et, ultrices a, suscipit eget, quam. Integer ut neque. Vivamus nisi metus, molestie vel, gravida in, condimentum sit amet, nunc. Nam a nibh. Donec suscipit eros. Nam mi. Proin viverra leo ut odio. Curabitur malesuada. Vestibulum a velit eu ante scelerisque vulputate.</p>
</div>
<h3><a href="#">Section 2</a></h3>
<h3>Section 2</h3>
<div>
<p>Sed non urna. Donec et ante. Phasellus eu ligula. Vestibulum sit amet purus. Vivamus hendrerit, dolor at aliquet laoreet, mauris turpis porttitor velit, faucibus interdum tellus libero ac justo. Vivamus non quam. In suscipit faucibus urna. </p>
</div>
<h3><a href="#">Section 3</a></h3>
<h3>Section 3</h3>
<div>
<p>Nam enim risus, molestie et, porta ac, aliquam ac, risus. Quisque lobortis. Phasellus pellentesque purus in massa. Aenean in pede. Phasellus ac libero ac tellus pellentesque semper. Sed ac felis. Sed commodo, magna quis lacinia ornare, quam ante aliquam nisi, eu iaculis leo purus venenatis dui. </p>
<ul>
@@ -49,7 +49,7 @@ <h3><a href="#">Section 3</a></h3>
<li>List item three</li>
</ul>
</div>
<h3><a href="#">Section 4</a></h3>
<h3>Section 4</h3>
<div>
<p>Cras dictum. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Aenean lacinia mauris vel est. </p><p>Suspendisse eu nisl. Nullam ut libero. Integer dignissim consequat lectus. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. </p>
</div>
@@ -20,7 +20,7 @@
<div class="demo">

<div id="accordion">
<h3><a href="#">Section 1</a></h3>
<h3>Section 1</h3>
<div>
<p>
Mauris mauris ante, blandit et, ultrices a, suscipit eget, quam. Integer
@@ -29,7 +29,7 @@ <h3><a href="#">Section 1</a></h3>
odio. Curabitur malesuada. Vestibulum a velit eu ante scelerisque vulputate.
</p>
</div>
<h3><a href="#">Section 2</a></h3>
<h3>Section 2</h3>
<div>
<p>
Sed non urna. Donec et ante. Phasellus eu ligula. Vestibulum sit amet
@@ -38,7 +38,7 @@ <h3><a href="#">Section 2</a></h3>
suscipit faucibus urna.
</p>
</div>
<h3><a href="#">Section 3</a></h3>
<h3>Section 3</h3>
<div>
<p>
Nam enim risus, molestie et, porta ac, aliquam ac, risus. Quisque lobortis.
@@ -52,7 +52,7 @@ <h3><a href="#">Section 3</a></h3>
<li>List item three</li>
</ul>
</div>
<h3><a href="#">Section 4</a></h3>
<h3>Section 4</h3>
<div>
<p>
Cras dictum. Pellentesque habitant morbi tristique senectus et netus
@@ -37,15 +37,15 @@ <h3 class="docs">Resize the outer container:</h3>
<div id="accordionResizer" style="padding:10px; width:350px; height:220px;" class="ui-widget-content">

<div id="accordion">
<h3><a href="#">Section 1</a></h3>
<h3>Section 1</h3>
<div>
<p>Mauris mauris ante, blandit et, ultrices a, suscipit eget, quam. Integer ut neque. Vivamus nisi metus, molestie vel, gravida in, condimentum sit amet, nunc. Nam a nibh. Donec suscipit eros. Nam mi. Proin viverra leo ut odio. Curabitur malesuada. Vestibulum a velit eu ante scelerisque vulputate.</p>
</div>
<h3><a href="#">Section 2</a></h3>
<h3>Section 2</h3>
<div>
<p>Sed non urna. Donec et ante. Phasellus eu ligula. Vestibulum sit amet purus. Vivamus hendrerit, dolor at aliquet laoreet, mauris turpis porttitor velit, faucibus interdum tellus libero ac justo. Vivamus non quam. In suscipit faucibus urna. </p>
</div>
<h3><a href="#">Section 3</a></h3>
<h3>Section 3</h3>
<div>
<p>Nam enim risus, molestie et, porta ac, aliquam ac, risus. Quisque lobortis. Phasellus pellentesque purus in massa. Aenean in pede. Phasellus ac libero ac tellus pellentesque semper. Sed ac felis. Sed commodo, magna quis lacinia ornare, quam ante aliquam nisi, eu iaculis leo purus venenatis dui. </p>
<ul>
@@ -54,7 +54,7 @@ <h3><a href="#">Section 3</a></h3>
<li>List item three</li>
</ul>
</div>
<h3><a href="#">Section 4</a></h3>
<h3>Section 4</h3>
<div>
<p>Cras dictum. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Aenean lacinia mauris vel est. </p><p>Suspendisse eu nisl. Nullam ut libero. Integer dignissim consequat lectus. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. </p>
</div>
@@ -73,7 +73,7 @@
<div class="demo">

<div id="accordion">
<h3><a href="#">Section 1</a></h3>
<h3>Section 1</h3>
<div>
<p>
Mauris mauris ante, blandit et, ultrices a, suscipit eget, quam. Integer
@@ -82,7 +82,7 @@ <h3><a href="#">Section 1</a></h3>
odio. Curabitur malesuada. Vestibulum a velit eu ante scelerisque vulputate.
</p>
</div>
<h3><a href="#">Section 2</a></h3>
<h3>Section 2</h3>
<div>
<p>
Sed non urna. Donec et ante. Phasellus eu ligula. Vestibulum sit amet
@@ -91,7 +91,7 @@ <h3><a href="#">Section 2</a></h3>
suscipit faucibus urna.
</p>
</div>
<h3><a href="#">Section 3</a></h3>
<h3>Section 3</h3>
<div>
<p>
Nam enim risus, molestie et, porta ac, aliquam ac, risus. Quisque lobortis.
@@ -105,7 +105,7 @@ <h3><a href="#">Section 3</a></h3>
<li>List item three</li>
</ul>
</div>
<h3><a href="#">Section 4</a></h3>
<h3>Section 4</h3>
<div>
<p>
Cras dictum. Pellentesque habitant morbi tristique senectus et netus
@@ -22,15 +22,15 @@
<div class="demo">

<div id="accordion">
<h3><a href="#">Section 1</a></h3>
<h3>Section 1</h3>
<div>
<p>Mauris mauris ante, blandit et, ultrices a, suscipit eget, quam. Integer ut neque. Vivamus nisi metus, molestie vel, gravida in, condimentum sit amet, nunc. Nam a nibh. Donec suscipit eros. Nam mi. Proin viverra leo ut odio. Curabitur malesuada. Vestibulum a velit eu ante scelerisque vulputate.</p>
</div>
<h3><a href="#">Section 2</a></h3>
<h3>Section 2</h3>
<div>
<p>Sed non urna. Donec et ante. Phasellus eu ligula. Vestibulum sit amet purus. Vivamus hendrerit, dolor at aliquet laoreet, mauris turpis porttitor velit, faucibus interdum tellus libero ac justo. Vivamus non quam. In suscipit faucibus urna. </p>
</div>
<h3><a href="#">Section 3</a></h3>
<h3>Section 3</h3>
<div>
<p>Nam enim risus, molestie et, porta ac, aliquam ac, risus. Quisque lobortis. Phasellus pellentesque purus in massa. Aenean in pede. Phasellus ac libero ac tellus pellentesque semper. Sed ac felis. Sed commodo, magna quis lacinia ornare, quam ante aliquam nisi, eu iaculis leo purus venenatis dui. </p>
<ul>
@@ -39,7 +39,7 @@ <h3><a href="#">Section 3</a></h3>
<li>List item three</li>
</ul>
</div>
<h3><a href="#">Section 4</a></h3>
<h3>Section 4</h3>
<div>
<p>Cras dictum. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Aenean lacinia mauris vel est. </p><p>Suspendisse eu nisl. Nullam ut libero. Integer dignissim consequat lectus. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. </p>
</div>
@@ -22,15 +22,15 @@
<div class="demo">

<div id="accordion">
<h3><a href="#section1">Section 1</a></h3>
<h3>Section 1</h3>
<div>
<p>Mauris mauris ante, blandit et, ultrices a, susceros. Nam mi. Proin viverra leo ut odio. Curabitur malesuada. Vestibulum a velit eu ante scelerisque vulputate.</p>
</div>
<h3><a href="#section2">Section 2</a></h3>
<h3>Section 2</h3>
<div>
<p>Sed non urna. Donec et ante. Phasellus eu ligula. Vestibulum sit amet purus. Vivamus hendrerit, dolor at aliquet laoreet, mauris turpis porttitor velit, faucibus interdum tellus libero ac justo. Vivamus non quam. In suscipit faucibus urna. </p>
</div>
<h3><a href="#section3">Section 3</a></h3>
<h3>Section 3</h3>
<div>
<p>Nam enim risus, molestie et, porta ac, aliquam ac, risus. Quisque lobortis. Phasellus pellentesque purus in massa. Aenean in pede. Phasellus ac libero ac tellus pellentesque semper. Sed ac felis. Sed commodo, magna quis lacinia ornare, quam ante aliquam nisi, eu iaculis leo purus venenatis dui. </p>
<ul>
@@ -42,7 +42,6 @@ <h3><a href="#section3">Section 3</a></h3>
<li>List item</li>
<li>List item</li>
</ul>
<a href="#othercontent">Link to other content</a>
</div>
</div>

@@ -39,19 +39,19 @@

<div id="accordion">
<div class="group">
<h3><a href="#">Section 1</a></h3>
<h3>Section 1</h3>
<div>
<p>Mauris mauris ante, blandit et, ultrices a, suscipit eget, quam. Integer ut neque. Vivamus nisi metus, molestie vel, gravida in, condimentum sit amet, nunc. Nam a nibh. Donec suscipit eros. Nam mi. Proin viverra leo ut odio. Curabitur malesuada. Vestibulum a velit eu ante scelerisque vulputate.</p>
</div>
</div>
<div class="group">
<h3><a href="#">Section 2</a></h3>
<h3>Section 2</h3>
<div>
<p>Sed non urna. Donec et ante. Phasellus eu ligula. Vestibulum sit amet purus. Vivamus hendrerit, dolor at aliquet laoreet, mauris turpis porttitor velit, faucibus interdum tellus libero ac justo. Vivamus non quam. In suscipit faucibus urna. </p>
</div>
</div>
<div class="group">
<h3><a href="#">Section 3</a></h3>
<h3>Section 3</h3>
<div>
<p>Nam enim risus, molestie et, porta ac, aliquam ac, risus. Quisque lobortis. Phasellus pellentesque purus in massa. Aenean in pede. Phasellus ac libero ac tellus pellentesque semper. Sed ac felis. Sed commodo, magna quis lacinia ornare, quam ante aliquam nisi, eu iaculis leo purus venenatis dui. </p>
<ul>
@@ -62,7 +62,7 @@ <h3><a href="#">Section 3</a></h3>
</div>
</div>
<div class="group">
<h3><a href="#">Section 4</a></h3>
<h3>Section 4</h3>
<div>
<p>Cras dictum. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Aenean lacinia mauris vel est. </p><p>Suspendisse eu nisl. Nullam ut libero. Integer dignissim consequat lectus. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. </p>
</div>
@@ -51,7 +51,7 @@ <h2 id="qunit-userAgent"></h2>
<div id="qunit-fixture">

<div id="list1" class="foo">
<h3 class="bar"><a class="anchor">There is one obvious advantage:</a></h3>
<h3 class="bar">There is one obvious advantage:</h3>
<div class="foo">
<p>
You've seen it coming!
@@ -61,7 +61,7 @@ <h3 class="bar"><a class="anchor">There is one obvious advantage:</a></h3>
Well, at least no free beer. Perhaps a bear, if you can afford it.
</p>
</div>
<h3 class="bar"><a class="anchor">Now that you've got...</a></h3>
<h3 class="bar">Now that you've got...</h3>
<div class="foo">
<p>
your bear, you have to admit it!
@@ -72,7 +72,7 @@ <h3 class="bar"><a class="anchor">Now that you've got...</a></h3>
We could talk about renting one.
</p>
</div>
<h3 class="bar"><a class="anchor">Rent one bear, ...</a></h3>
<h3 class="bar">Rent one bear, ...</h3>
<div class="foo">
<p>
get two for three beer.
@@ -120,19 +120,19 @@ <h2><a href="?p=1.1.3">Drums</a></h2>

<dl id="accordion-dl">
<dt>
<a href="#">Accordion Header 1</a>
Accordion Header 1
</dt>
<dd>
Accordion Content 1
</dd>
<dt>
<a href="#">Accordion Header 2</a>
Accordion Header 2
</dt>
<dd>
Accordion Content 2
</dd>
<dt>
<a href="#">Accordion Header 3</a>
Accordion Header 3
</dt>
<dd>
Accordion Content 3
@@ -24,13 +24,6 @@ test( "handle click on header-descendant", function() {
accordion_state( element, 0, 1, 0 );
});

test( "ui-accordion-heading class added to headers anchor", function() {
expect( 1 );
var element = $( "#list1" ).accordion();
var anchors = element.find( ".ui-accordion-heading" );
equal( anchors.length, 3 );
});

test( "accessibility", function () {
expect( 13 );
var element = $( "#list1" ).accordion().accordion( "option", "active", 1 );
@@ -49,7 +49,7 @@ <h2 id="qunit-userAgent"></h2>
<div id="qunit-fixture">

<div id="list1" class="foo">
<h3 class="bar"><a class="anchor">There is one obvious advantage:</a></h3>
<h3 class="bar">There is one obvious advantage:</h3>
<div class="foo">
<p>
You've seen it coming!
@@ -59,7 +59,7 @@ <h3 class="bar"><a class="anchor">There is one obvious advantage:</a></h3>
Well, at least no free beer. Perhaps a bear, if you can afford it.
</p>
</div>
<h3 class="bar"><a class="anchor">Now that you've got...</a></h3>
<h3 class="bar">Now that you've got...</h3>
<div class="foo">
<p>
your bear, you have to admit it!
@@ -70,7 +70,7 @@ <h3 class="bar"><a class="anchor">Now that you've got...</a></h3>
We could talk about renting one.
</p>
</div>
<h3 class="bar"><a class="anchor">Rent one bear, ...</a></h3>
<h3 class="bar">Rent one bear, ...</h3>
<div class="foo">
<p>
get two for three beer.
@@ -118,19 +118,19 @@ <h2><a href="?p=1.1.3">Drums</a></h2>

<dl id="accordion-dl">
<dt>
<a href="#">Accordion Header 1</a>
Accordion Header 1
</dt>
<dd>
Accordion Content 1
</dd>
<dt>
<a href="#">Accordion Header 2</a>
Accordion Header 2
</dt>
<dd>
Accordion Content 2
</dd>
<dt>
<a href="#">Accordion Header 3</a>
Accordion Header 3
</dt>
<dd>
Accordion Content 3
@@ -9,11 +9,10 @@
*/
/* IE/Win - Fix animation bug - #4615 */
.ui-accordion { width: 100%; }
.ui-accordion .ui-accordion-header { cursor: pointer; position: relative; margin-top: 2px; zoom: 1; }
.ui-accordion .ui-accordion-heading { display: block; font-size: 1em; padding: .5em .5em .5em .7em; }
.ui-accordion-icons a.ui-accordion-heading { padding-left: 2.2em; }
.ui-accordion-noicons a.ui-accordion-heading { padding-left: .7em; }
.ui-accordion-icons .ui-accordion-icons a.ui-accordion-heading { padding-left: 2.2em; }
.ui-accordion .ui-accordion-header { display: block; cursor: pointer; position: relative; margin-top: 2px; padding: .5em .5em .5em .7em; zoom: 1; }
.ui-accordion .ui-accordion-icons { padding-left: 2.2em; }
.ui-accordion .ui-accordion-noicons { padding-left: .7em; }
.ui-accordion .ui-accordion-icons .ui-accordion-icons { padding-left: 2.2em; }
.ui-accordion .ui-accordion-header .ui-accordion-header-icon { position: absolute; left: .5em; top: 50%; margin-top: -8px; }
.ui-accordion .ui-accordion-content { padding: 1em 2.2em; border-top: 0; overflow: auto; display: none; zoom: 1; }
.ui-accordion .ui-accordion-content-active { display: block; }

0 comments on commit 0285529

Please sign in to comment.
You can’t perform that action at this time.