*/
(function( $, undefined ) {
-var lastToggle = {};
-
// TODO: use ui-accordion-header-active class and fix styling
$.widget( "ui.accordion", {
version: "@VERSION",
var self = this,
options = self.options;
+ self.lastToggle = {};
self.element.addClass( "ui-accordion ui-widget ui-helper-reset" );
self.headers = self.element.find( options.header )
}
animations[ animation ]({
+ widget: self,
toShow: toShow,
toHide: toHide,
- prevShow: lastToggle.toShow,
- prevHide: lastToggle.toHide,
+ prevShow: self.lastToggle.toShow,
+ prevHide: self.lastToggle.toHide,
complete: complete,
down: toShow.length && ( !toHide.length || ( toShow.index() < toHide.index() ) )
}, additional );
duration: 300
}, options, additions );
- lastToggle = options;
+ options.widget.lastToggle = options;
if ( !options.toHide.size() ) {
originalWidth = options.toShow[0].style.width;