r1914 - in trunk: demos/accordion tests/visual/accordion themes/base ui

r1914 - in trunk: demos/accordion tests/visual/accordion themes/base ui


Author: joern.zaefferer
Date: Fri Jan 30 12:42:03 2009
New Revision: 1914
Added:
trunk/tests/visual/accordion/ul.html (contents, props changed)
Modified:
trunk/demos/accordion/noAutoHeight.html
trunk/themes/base/ui.accordion.css
trunk/ui/ui.accordion.js
Log:
accordion: added ul-visual-test; improved solution for fixing
ul-accordions, no more potential scope issues
Modified: trunk/demos/accordion/noAutoHeight.html
==============================================================================
--- trunk/demos/accordion/noAutoHeight.html    (original)
+++ trunk/demos/accordion/noAutoHeight.html    Fri Jan 30 12:42:03 2009
@@ -31,9 +31,6 @@
    <h3><a href="#">Section 3</a></h3>
    <div>
        

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.




-        

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.




-        

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.




-        

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.




        <ul>
            <li>List item</li>
            <li>List item</li>
Added: trunk/tests/visual/accordion/ul.html
==============================================================================
--- (empty file)
+++ trunk/tests/visual/accordion/ul.html    Fri Jan 30 12:42:03 2009
@@ -0,0 +1,45 @@
+<!doctype html>
+<html>
+ <head>
+ <title>Accordion Visual Test : UL</title>
+ <link rel="stylesheet" href="../../static/static.css"
type="text/css" />
+ <link rel="stylesheet" href="../../../themes/base/ui.base.css"
type="text/css" />
+ <link rel="stylesheet" href="../../../themes/base/ui.theme.css"
type="text/css" title="ui-theme" />
+ <script type="text/javascript"
src="../../../jquery-1.3.1.js"></script>
+ <script type="text/javascript"
src="../../../ui/ui.core.js"></script>
+ <script type="text/javascript"
src="../../../ui/ui.accordion.js"></script>
+ <script type="text/javascript">
+ $(function(){
+ $("#accordion").accordion()
+ });
+ </script>
+ </head>
+ <body>
+ <ul id="accordion">
+ <li>
+ <h2>
+ <a href="#">Accordion Header 1</a>
+ </h2>
+ <div>
+     Accordion Content 1
+                    <ul>
+                        <li>Some list item</li>
+                        <li>Some list item</li>
+                    </ul>
+                </div>
+ </li>
+ <li>
+ <h2>
+ <a href="#">Accordion Header 2</a>
+ </h2>
+ <div>Accordion Content 2</div>
+ </li>
+ <li>
+ <h2>
+ <a href="#">Accordion Header 3</a>
+ </h2>
+ <div>Accordion Content 2</div>
+ </li>
+ </ul>
+ </body>
+</html>
Modified: trunk/themes/base/ui.accordion.css
==============================================================================
--- trunk/themes/base/ui.accordion.css    (original)
+++ trunk/themes/base/ui.accordion.css    Fri Jan 30 12:42:03 2009
@@ -1,8 +1,7 @@
/* Accordion
----------------------------------*/
.ui-accordion .ui-accordion-header { cursor: pointer; position: relative;
margin-top: 1px; zoom: 1; }
-.ui-accordion li {display: inline;}
-.ui-accordion .ui-accordion-content li {display: list-item;}
+.ui-accordion .ui-accordion-li-fix { display: inline; }
.ui-accordion .ui-accordion-header-active { border-bottom: 0 !important; }
.ui-accordion .ui-accordion-header a { display: block; font-size: 1em;
padding: .5em .5em .5em 2.2em; }
.ui-accordion .ui-accordion-header .ui-icon { position: absolute;
left: .5em; top: 50%; margin-top: -8px; }
Modified: trunk/ui/ui.accordion.js
==============================================================================
--- trunk/ui/ui.accordion.js    (original)
+++ trunk/ui/ui.accordion.js    Fri Jan 30 12:42:03 2009
@@ -32,6 +32,11 @@
        }
        this.element.addClass("ui-accordion ui-widget ui-helper-reset");
+        
+        // in lack of child-selectors in CSS we need to mark top-LIs in a
UL-accordion for some IE-fix
+        if (this.element[0].nodeName == "UL") {
+            this.element.children("li").addClass("ui-accordion-li-fix");
+        }
        this.headers = this.element.find(o.header).addClass("ui-accordion-header
ui-helper-reset ui-state-default ui-corner-all")
            .bind("mouseenter.accordion", function(){
$(this).addClass('ui-state-hover'); })
@@ -369,7 +374,7 @@
        clearStyle: false,
        event: "click",
        fillSpace: false,
-        header: "> li :first,> :not(li):even",
+        header: "> li > :first-child,> :not(li):even",
        icons: {
            header: "ui-icon-triangle-1-e",
            headerSelected: "ui-icon-triangle-1-s"