aboutsummaryrefslogtreecommitdiffstats
path: root/ui
diff options
context:
space:
mode:
authorScott González <scott.gonzalez@gmail.com>2011-01-25 00:05:55 -0500
committerScott González <scott.gonzalez@gmail.com>2011-01-25 00:05:55 -0500
commit088ef05142168de75d2afcbe447a5b44cb2d3673 (patch)
tree25c75a5a1a2dcd70d6c4324c13ae4e49ee4e8c67 /ui
parent06d61f5f235f4869bc251ebd1e1e768c56297636 (diff)
downloadjquery-ui-088ef05142168de75d2afcbe447a5b44cb2d3673.tar.gz
jquery-ui-088ef05142168de75d2afcbe447a5b44cb2d3673.zip
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.
Diffstat (limited to 'ui')
-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 );