aboutsummaryrefslogtreecommitdiffstats
path: root/ui/jquery.ui.accordion.js
diff options
context:
space:
mode:
Diffstat (limited to 'ui/jquery.ui.accordion.js')
-rw-r--r--ui/jquery.ui.accordion.js22
1 files changed, 19 insertions, 3 deletions
diff --git a/ui/jquery.ui.accordion.js b/ui/jquery.ui.accordion.js
index d855da5f3..cd6a2ce93 100644
--- a/ui/jquery.ui.accordion.js
+++ b/ui/jquery.ui.accordion.js
@@ -381,8 +381,7 @@ $.widget( "ui.accordion", {
return self._completed.apply( self, arguments );
};
- // trigger changestart event
- self._trigger( "changestart", null, self.data );
+ self._trigger( "beforeActivate", null, self.data );
// count elements to animate
self.running = toHide.size() === 0 ? toShow.size() : toHide.size();
@@ -487,7 +486,7 @@ $.widget( "ui.accordion", {
this.toHide.parent()[0].className = this.toHide.parent()[0].className;
}
- this._trigger( "change", null, this.data );
+ this._trigger( "activate", null, this.data );
}
});
@@ -711,6 +710,23 @@ if ( $.uiBackCompat !== false ) {
// resize method
jQuery.ui.accordion.prototype.resize = jQuery.ui.accordion.prototype.refresh;
+
+ (function( $, prototype ) {
+ var _trigger = prototype._trigger;
+ prototype._trigger = function( type, event, data ) {
+ var ret = _trigger.apply( this, arguments );
+ if ( !ret ) {
+ return false;
+ }
+
+ if ( type === "beforeActivate" ) {
+ ret = _trigger.call( this, "changestart", event, data );
+ } else if ( type === "activate" ) {
+ ret = _trigger.call( this, "change", event, data );
+ }
+ return ret;
+ }
+ }( jQuery, jQuery.ui.accordion.prototype ) );
}
})( jQuery );