Tabs: Make sure prototype.url is defined before trying to shim it

This commit is contained in:
David Petersen 2011-04-28 09:07:54 -04:00 committed by Scott González
parent 60d4e0ae42
commit a1473042b4

17
ui/jquery.ui.tabs.js vendored
View File

@ -628,6 +628,14 @@ $.extend( $.ui.tabs, {
// DEPRECATED // DEPRECATED
if ( $.uiBackCompat !== false ) { if ( $.uiBackCompat !== false ) {
// url method
(function( $, prototype ) {
prototype.url = function( index, url ) {
this.anchors.eq( index ).attr( "href", url );
};
}( jQuery, jQuery.ui.tabs.prototype ) );
// ajaxOptions and cache options // ajaxOptions and cache options
(function( $, prototype ) { (function( $, prototype ) {
$.extend( prototype.options, { $.extend( prototype.options, {
@ -638,7 +646,7 @@ if ( $.uiBackCompat !== false ) {
var _create = prototype._create, var _create = prototype._create,
_setOption = prototype._setOption, _setOption = prototype._setOption,
_destroy = prototype._destroy, _destroy = prototype._destroy,
oldurl = prototype._url; oldurl = prototype.url || $.noop;
$.extend( prototype, { $.extend( prototype, {
_create: function() { _create: function() {
@ -864,13 +872,6 @@ if ( $.uiBackCompat !== false ) {
}; };
}( jQuery, jQuery.ui.tabs.prototype ) ); }( jQuery, jQuery.ui.tabs.prototype ) );
// url method
(function( $, prototype ) {
prototype.url = function( index, url ) {
this.anchors.eq( index ).attr( "href", url );
};
}( jQuery, jQuery.ui.tabs.prototype ) );
// panel ids (idPrefix option + title attribute) // panel ids (idPrefix option + title attribute)
(function( $, prototype ) { (function( $, prototype ) {
$.extend( prototype.options, { $.extend( prototype.options, {