From 02855292f2746d2c6f64a729730727df6684c6c7 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Scott=20Gonz=C3=A1lez?= Date: Sun, 26 Feb 2012 21:37:44 -0500 Subject: [PATCH] Accordion: Removed requirement for headers contain a child (and removed associated ui-accordion-heading class). --- demos/accordion/collapsible.html | 8 ++++---- demos/accordion/custom-icons.html | 8 ++++---- demos/accordion/default.html | 8 ++++---- demos/accordion/fillspace.html | 8 ++++---- demos/accordion/hoverintent.html | 8 ++++---- demos/accordion/mouseover.html | 8 ++++---- demos/accordion/no-auto-height.html | 7 +++---- demos/accordion/sortable.html | 8 ++++---- tests/unit/accordion/accordion.html | 12 ++++++------ tests/unit/accordion/accordion_core.js | 7 ------- tests/unit/accordion/accordion_deprecated.html | 12 ++++++------ themes/base/jquery.ui.accordion.css | 9 ++++----- ui/jquery.ui.accordion.js | 9 --------- 13 files changed, 47 insertions(+), 65 deletions(-) diff --git a/demos/accordion/collapsible.html b/demos/accordion/collapsible.html index 310e550a9..922df00cb 100644 --- a/demos/accordion/collapsible.html +++ b/demos/accordion/collapsible.html @@ -22,15 +22,15 @@
-

Section 1

+

Section 1

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.

-

Section 2

+

Section 2

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.

-

Section 3

+

Section 3

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.

    @@ -39,7 +39,7 @@
  • List item three
-

Section 4

+

Section 4

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.

Suspendisse eu nisl. Nullam ut libero. Integer dignissim consequat lectus. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos.

diff --git a/demos/accordion/custom-icons.html b/demos/accordion/custom-icons.html index e2fc9bdb1..c41af1120 100644 --- a/demos/accordion/custom-icons.html +++ b/demos/accordion/custom-icons.html @@ -32,15 +32,15 @@
-

Section 1

+

Section 1

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.

-

Section 2

+

Section 2

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.

-

Section 3

+

Section 3

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.

    @@ -49,7 +49,7 @@
  • List item three
-

Section 4

+

Section 4

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.

Suspendisse eu nisl. Nullam ut libero. Integer dignissim consequat lectus. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos.

diff --git a/demos/accordion/default.html b/demos/accordion/default.html index 4afc2b129..67197aa20 100644 --- a/demos/accordion/default.html +++ b/demos/accordion/default.html @@ -20,7 +20,7 @@
-

Section 1

+

Section 1

Mauris mauris ante, blandit et, ultrices a, suscipit eget, quam. Integer @@ -29,7 +29,7 @@ odio. Curabitur malesuada. Vestibulum a velit eu ante scelerisque vulputate.

-

Section 2

+

Section 2

Sed non urna. Donec et ante. Phasellus eu ligula. Vestibulum sit amet @@ -38,7 +38,7 @@ suscipit faucibus urna.

-

Section 3

+

Section 3

Nam enim risus, molestie et, porta ac, aliquam ac, risus. Quisque lobortis. @@ -52,7 +52,7 @@

  • List item three
  • -

    Section 4

    +

    Section 4

    Cras dictum. Pellentesque habitant morbi tristique senectus et netus diff --git a/demos/accordion/fillspace.html b/demos/accordion/fillspace.html index 3a7d81edc..6095fa33f 100644 --- a/demos/accordion/fillspace.html +++ b/demos/accordion/fillspace.html @@ -37,15 +37,15 @@

    -

    Section 1

    +

    Section 1

    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.

    -

    Section 2

    +

    Section 2

    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.

    -

    Section 3

    +

    Section 3

    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.

      @@ -54,7 +54,7 @@
    • List item three
    -

    Section 4

    +

    Section 4

    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.

    Suspendisse eu nisl. Nullam ut libero. Integer dignissim consequat lectus. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos.

    diff --git a/demos/accordion/hoverintent.html b/demos/accordion/hoverintent.html index 8f628bda8..d08c64be6 100644 --- a/demos/accordion/hoverintent.html +++ b/demos/accordion/hoverintent.html @@ -73,7 +73,7 @@
    -

    Section 1

    +

    Section 1

    Mauris mauris ante, blandit et, ultrices a, suscipit eget, quam. Integer @@ -82,7 +82,7 @@ odio. Curabitur malesuada. Vestibulum a velit eu ante scelerisque vulputate.

    -

    Section 2

    +

    Section 2

    Sed non urna. Donec et ante. Phasellus eu ligula. Vestibulum sit amet @@ -91,7 +91,7 @@ suscipit faucibus urna.

    -

    Section 3

    +

    Section 3

    Nam enim risus, molestie et, porta ac, aliquam ac, risus. Quisque lobortis. @@ -105,7 +105,7 @@

  • List item three
  • -

    Section 4

    +

    Section 4

    Cras dictum. Pellentesque habitant morbi tristique senectus et netus diff --git a/demos/accordion/mouseover.html b/demos/accordion/mouseover.html index 6f4bc2e69..cbf6a78ac 100644 --- a/demos/accordion/mouseover.html +++ b/demos/accordion/mouseover.html @@ -22,15 +22,15 @@

    -

    Section 1

    +

    Section 1

    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.

    -

    Section 2

    +

    Section 2

    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.

    -

    Section 3

    +

    Section 3

    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.

      @@ -39,7 +39,7 @@
    • List item three
    -

    Section 4

    +

    Section 4

    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.

    Suspendisse eu nisl. Nullam ut libero. Integer dignissim consequat lectus. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos.

    diff --git a/demos/accordion/no-auto-height.html b/demos/accordion/no-auto-height.html index c51880b71..de07d625b 100644 --- a/demos/accordion/no-auto-height.html +++ b/demos/accordion/no-auto-height.html @@ -22,15 +22,15 @@
    -

    Section 1

    +

    Section 1

    Mauris mauris ante, blandit et, ultrices a, susceros. Nam mi. Proin viverra leo ut odio. Curabitur malesuada. Vestibulum a velit eu ante scelerisque vulputate.

    -

    Section 2

    +

    Section 2

    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.

    -

    Section 3

    +

    Section 3

    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.

      @@ -42,7 +42,6 @@
    • List item
    • List item
    - Link to other content
    diff --git a/demos/accordion/sortable.html b/demos/accordion/sortable.html index 60b5d3c70..cf9e8c86b 100644 --- a/demos/accordion/sortable.html +++ b/demos/accordion/sortable.html @@ -39,19 +39,19 @@
    -

    Section 1

    +

    Section 1

    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.

    -

    Section 2

    +

    Section 2

    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.

    -

    Section 3

    +

    Section 3

    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.

      @@ -62,7 +62,7 @@
    -

    Section 4

    +

    Section 4

    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.

    Suspendisse eu nisl. Nullam ut libero. Integer dignissim consequat lectus. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos.

    diff --git a/tests/unit/accordion/accordion.html b/tests/unit/accordion/accordion.html index ed9b1aa1d..109b3094e 100644 --- a/tests/unit/accordion/accordion.html +++ b/tests/unit/accordion/accordion.html @@ -51,7 +51,7 @@
    -

    There is one obvious advantage:

    +

    There is one obvious advantage:

    You've seen it coming! @@ -61,7 +61,7 @@ Well, at least no free beer. Perhaps a bear, if you can afford it.

    -

    Now that you've got...

    +

    Now that you've got...

    your bear, you have to admit it! @@ -72,7 +72,7 @@ We could talk about renting one.

    -

    Rent one bear, ...

    +

    Rent one bear, ...

    get two for three beer. @@ -120,19 +120,19 @@

    - Accordion Header 1 + Accordion Header 1
    Accordion Content 1
    - Accordion Header 2 + Accordion Header 2
    Accordion Content 2
    - Accordion Header 3 + Accordion Header 3
    Accordion Content 3 diff --git a/tests/unit/accordion/accordion_core.js b/tests/unit/accordion/accordion_core.js index 3442cad62..de1b66046 100644 --- a/tests/unit/accordion/accordion_core.js +++ b/tests/unit/accordion/accordion_core.js @@ -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 ); diff --git a/tests/unit/accordion/accordion_deprecated.html b/tests/unit/accordion/accordion_deprecated.html index f730d8029..583c1adcd 100644 --- a/tests/unit/accordion/accordion_deprecated.html +++ b/tests/unit/accordion/accordion_deprecated.html @@ -49,7 +49,7 @@
    -

    There is one obvious advantage:

    +

    There is one obvious advantage:

    You've seen it coming! @@ -59,7 +59,7 @@ Well, at least no free beer. Perhaps a bear, if you can afford it.

    -

    Now that you've got...

    +

    Now that you've got...

    your bear, you have to admit it! @@ -70,7 +70,7 @@ We could talk about renting one.

    -

    Rent one bear, ...

    +

    Rent one bear, ...

    get two for three beer. @@ -118,19 +118,19 @@

    - Accordion Header 1 + Accordion Header 1
    Accordion Content 1
    - Accordion Header 2 + Accordion Header 2
    Accordion Content 2
    - Accordion Header 3 + Accordion Header 3
    Accordion Content 3 diff --git a/themes/base/jquery.ui.accordion.css b/themes/base/jquery.ui.accordion.css index 721ef336e..2a423949c 100644 --- a/themes/base/jquery.ui.accordion.css +++ b/themes/base/jquery.ui.accordion.css @@ -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; } diff --git a/ui/jquery.ui.accordion.js b/ui/jquery.ui.accordion.js index 01600ba4e..48e964a94 100644 --- a/ui/jquery.ui.accordion.js +++ b/ui/jquery.ui.accordion.js @@ -42,7 +42,6 @@ $.widget( "ui.accordion", { .addClass( "ui-accordion-header ui-helper-reset ui-state-default ui-corner-all" ); this._hoverable( this.headers ); this._focusable( this.headers ); - this.headers.find( ":first-child" ).addClass( "ui-accordion-heading" ); this.headers.next() .addClass( "ui-accordion-content ui-helper-reset ui-widget-content ui-corner-bottom" ); @@ -95,11 +94,6 @@ $.widget( "ui.accordion", { }); } - // only need links in tab order for Safari - if ( !$.browser.safari ) { - this.headers.find( "a" ).attr( "tabIndex", -1 ); - } - this._setupEvents( options.event ); }, @@ -146,9 +140,6 @@ $.widget( "ui.accordion", { .removeAttr( "tabIndex" ) .find( "a" ) .removeAttr( "tabIndex" ) - .end() - .find( ".ui-accordion-heading" ) - .removeClass( "ui-accordion-heading" ); this._destroyIcons(); // clean up content panels -- 2.39.5