diff options
author | Scott González <scott.gonzalez@gmail.com> | 2013-01-22 09:19:04 -0500 |
---|---|---|
committer | Scott González <scott.gonzalez@gmail.com> | 2013-01-22 09:19:04 -0500 |
commit | 10c873ab6cf2333f7e51784e84c03a0fbb975e1f (patch) | |
tree | 35fb38582c111fafccd3b6c9deb8a630e17e89e0 | |
parent | 673c6558e01dd8a5423ec21bf40d6efe443580d2 (diff) | |
download | jquery-ui-10c873ab6cf2333f7e51784e84c03a0fbb975e1f.tar.gz jquery-ui-10c873ab6cf2333f7e51784e84c03a0fbb975e1f.zip |
Accordion: Add panel in addition to content for create event. Fixes #8998 - Accordion: Create event uses content instead of panel.
-rw-r--r-- | tests/unit/accordion/accordion_events.js | 7 | ||||
-rw-r--r-- | ui/jquery.ui.accordion.js | 1 |
2 files changed, 7 insertions, 1 deletions
diff --git a/tests/unit/accordion/accordion_events.js b/tests/unit/accordion/accordion_events.js index b67f2b26d..79283d11c 100644 --- a/tests/unit/accordion/accordion_events.js +++ b/tests/unit/accordion/accordion_events.js @@ -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" ); } }); diff --git a/ui/jquery.ui.accordion.js b/ui/jquery.ui.accordion.js index d8faa0e9f..1afa95cb4 100644 --- a/ui/jquery.ui.accordion.js +++ b/ui/jquery.ui.accordion.js @@ -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() }; }, |