From 088ef05142168de75d2afcbe447a5b44cb2d3673 Mon Sep 17 00:00:00 2001 From: Scott González Date: Tue, 25 Jan 2011 00:05:55 -0500 Subject: Accordion: Renamed changestart and change events to beforeActivate and activate, respectively. Fixes #6840 - Accordion: Rename changestart event to beforeActivate. Fixes #6842 - Accordion: Rename change event to activate. --- ui/jquery.ui.accordion.js | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) (limited to 'ui') 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 ); -- cgit v1.2.3