2015-04-07 14:30:07 +00:00
|
|
|
define( [
|
|
|
|
"jquery",
|
|
|
|
"lib/helper",
|
2015-07-15 01:54:33 +00:00
|
|
|
"ui/widgets/accordion"
|
2015-04-07 14:30:07 +00:00
|
|
|
], function( $, helper ) {
|
2015-04-03 19:24:09 +00:00
|
|
|
|
2015-04-07 14:30:07 +00:00
|
|
|
return $.extend( helper, {
|
2012-05-28 16:41:57 +00:00
|
|
|
equalHeight: function( accordion, height ) {
|
2012-04-19 15:37:33 +00:00
|
|
|
accordion.find( ".ui-accordion-content" ).each(function() {
|
2012-05-28 16:41:57 +00:00
|
|
|
equal( $( this ).outerHeight(), height );
|
2012-04-19 15:37:33 +00:00
|
|
|
});
|
|
|
|
},
|
2011-08-03 17:52:36 +00:00
|
|
|
|
2012-04-19 15:37:33 +00:00
|
|
|
setupTeardown: function() {
|
|
|
|
var animate = $.ui.accordion.prototype.options.animate;
|
|
|
|
return {
|
|
|
|
setup: function() {
|
|
|
|
$.ui.accordion.prototype.options.animate = false;
|
|
|
|
},
|
|
|
|
teardown: function() {
|
|
|
|
$.ui.accordion.prototype.options.animate = animate;
|
|
|
|
}
|
|
|
|
};
|
|
|
|
},
|
2011-08-03 17:52:36 +00:00
|
|
|
|
2012-04-19 15:37:33 +00:00
|
|
|
state: function( accordion ) {
|
|
|
|
var expected = $.makeArray( arguments ).slice( 1 ),
|
|
|
|
actual = accordion.find( ".ui-accordion-content" ).map(function() {
|
2015-04-03 19:24:09 +00:00
|
|
|
return $( this ).css( "display" ) === "none" ? 0 : 1;
|
|
|
|
}).get();
|
2012-04-19 15:37:33 +00:00
|
|
|
QUnit.push( QUnit.equiv(actual, expected), actual, expected );
|
|
|
|
}
|
2015-04-07 14:30:07 +00:00
|
|
|
} );
|
2015-04-03 19:24:09 +00:00
|
|
|
|
|
|
|
} );
|