]> source.dussan.org Git - jquery-ui.git/commitdiff
Accordion: Add panel in addition to content for create event. Fixes #8998 - Accordion...
authorScott González <scott.gonzalez@gmail.com>
Tue, 22 Jan 2013 14:19:04 +0000 (09:19 -0500)
committerScott González <scott.gonzalez@gmail.com>
Tue, 22 Jan 2013 14:19:04 +0000 (09:19 -0500)
tests/unit/accordion/accordion_events.js
ui/jquery.ui.accordion.js

index b67f2b26d803d14e2b1bf91f7313b6624041a30f..79283d11c435122ed71e923d31a8d840c81a5e5e 100644 (file)
@@ -6,7 +6,7 @@ var setupTeardown = TestHelpers.accordion.setupTeardown,
 module( "accordion: events", setupTeardown() );
 
 test( "create", function() {
-       expect( 10 );
+       expect( 15 );
 
        var element = $( "#list1" ),
                headers = element.children( "h3" ),
@@ -16,6 +16,8 @@ test( "create", function() {
                create: function( event, ui ) {
                        equal( ui.header.length, 1, "header length" );
                        strictEqual( ui.header[ 0 ], headers[ 0 ], "header" );
+                       equal( ui.panel.length, 1, "panel length" );
+                       strictEqual( ui.panel[ 0 ], contents[ 0 ], "panel" );
                        equal( ui.content.length, 1, "content length" );
                        strictEqual( ui.content[ 0 ], contents[ 0 ], "content" );
                }
@@ -27,6 +29,8 @@ test( "create", function() {
                create: function( event, ui ) {
                        equal( ui.header.length, 1, "header length" );
                        strictEqual( ui.header[ 0 ], headers[ 2 ], "header" );
+                       equal( ui.panel.length, 1, "panel length" );
+                       strictEqual( ui.panel[ 0 ], contents[ 2 ], "panel" );
                        equal( ui.content.length, 1, "content length" );
                        strictEqual( ui.content[ 0 ], contents[ 2 ], "content" );
                }
@@ -38,6 +42,7 @@ test( "create", function() {
                collapsible: true,
                create: function( event, ui ) {
                        equal( ui.header.length, 0, "header length" );
+                       equal( ui.panel.length, 0, "panel length" );
                        equal( ui.content.length, 0, "content length" );
                }
        });
index d8faa0e9f8aec748e2df9fed112b413334185fd3..1afa95cb4b0071108280dea8846a287c2db7c4af 100644 (file)
@@ -65,6 +65,7 @@ $.widget( "ui.accordion", {
        _getCreateEventData: function() {
                return {
                        header: this.active,
+                       panel: !this.active.length ? $() : this.active.next(),
                        content: !this.active.length ? $() : this.active.next()
                };
        },