diff options
author | David Petersen <public@petersendidit.com> | 2011-03-27 16:55:05 -0400 |
---|---|---|
committer | David Petersen <public@petersendidit.com> | 2011-03-27 16:55:05 -0400 |
commit | 787efd307aff11ad3c51a72f520c58b8158ae973 (patch) | |
tree | 737bb66e455e424c0c4a6cfe27edea0ebc652f6d /ui | |
parent | 9a00fd4c5ef637f29afc6debda4db136f1fcb3fb (diff) | |
download | jquery-ui-787efd307aff11ad3c51a72f520c58b8158ae973.tar.gz jquery-ui-787efd307aff11ad3c51a72f520c58b8158ae973.zip |
Tabs: Rename show event to activate. Fixes #7137 Tabs: Rename show event to activate
Diffstat (limited to 'ui')
-rwxr-xr-x | ui/jquery.ui.tabs.js | 32 |
1 files changed, 25 insertions, 7 deletions
diff --git a/ui/jquery.ui.tabs.js b/ui/jquery.ui.tabs.js index d76565a2a..d605b2d48 100755 --- a/ui/jquery.ui.tabs.js +++ b/ui/jquery.ui.tabs.js @@ -26,6 +26,7 @@ function getNextListId() { $.widget( "ui.tabs", { options: { + activate: null, beforeload: null, cookie: null, // e.g. { expires: 7, path: '/', domain: 'jquery.com', secure: true } collapsible: false, @@ -33,8 +34,7 @@ $.widget( "ui.tabs", { event: "click", fx: null, // e.g. { height: 'toggle', opacity: 'toggle', duration: 200 } load: null, - select: null, - show: null + select: null }, _create: function() { @@ -103,9 +103,9 @@ $.widget( "ui.tabs", { this.lis.eq( o.active ).addClass( "ui-tabs-selected ui-state-active" ); - // seems to be expected behavior that the show callback is fired + // seems to be expected behavior that the activate callback is fired self.element.queue( "tabs", function() { - self._trigger( "show", null, self._ui( tab, panel[ 0 ] ) ); + self._trigger( "activate", null, self._ui( tab, panel[ 0 ] ) ); }); this.load( o.active ); @@ -304,11 +304,11 @@ $.widget( "ui.tabs", { .animate( showFx, showFx.duration || "normal", function() { self._resetStyle( show, showFx ); self.running = false; - self._trigger( "show", event, self._ui( clicked, show[ 0 ] ) ); + self._trigger( "activate", event, self._ui( clicked, show[ 0 ] ) ); }); } else { show.removeClass( "ui-tabs-hide" ); - self._trigger( "show", event, self._ui( clicked, show[ 0 ] ) ); + self._trigger( "activate", event, self._ui( clicked, show[ 0 ] ) ); } }, @@ -815,7 +815,7 @@ if ( $.uiBackCompat !== false ) { $li.addClass( "ui-tabs-selected ui-state-active" ); $panel.removeClass( "ui-tabs-hide" ); this.element.queue( "tabs", function() { - self._trigger( "show", null, self._ui( self.anchors[ 0 ], self.panels[ 0 ] ) ); + self._trigger( "activate", null, self._ui( self.anchors[ 0 ], self.panels[ 0 ] ) ); }); this.load( 0 ); @@ -926,6 +926,24 @@ if ( $.uiBackCompat !== false ) { this.options.selected = this.options.active ; }; }( jQuery, jQuery.ui.tabs.prototype ) ); + + // show event + (function( $, prototype ) { + $.extend( prototype.options, { + show: null + }); + var _trigger = prototype._trigger; + + prototype._trigger = function( type, event, data ) { + var ret = _trigger.apply( this, arguments ); + if ( !ret ) { + return false; + } + if ( type === "activate" ) { + ret = _trigger.call( this, "show", event, data ); + } + }; + }( jQuery, jQuery.ui.tabs.prototype ) ); } })( jQuery ); |