ok(false, "missing test - untested code is broken code.");
});
-test('idPrefix', function() {
- ok(false, "missing test - untested code is broken code.");
-});
-
-test('panelTemplate', function() {
- ok(false, "missing test - untested code is broken code.");
-});
-
test('selected', function() {
expect(8);
equals(el.tabs('option', 'selected'), 0, 'should not collapse tab if value is same as selected');
});
-test('tabTemplate', function() {
- ok(false, "missing test - untested code is broken code.");
-});
-
})(jQuery);
disabled: false,
event: "click",
fx: null, // e.g. { height: 'toggle', opacity: 'toggle', duration: 200 }
- idPrefix: "ui-tabs-",
load: null,
- panelTemplate: "<div></div>",
select: null,
- show: null,
- tabTemplate: "<li><a href='#{href}'><span>#{label}</span></a></li>"
+ show: null
},
_create: function() {
_tabId: function( a ) {
return ( $( a ).attr( "aria-controls" ) || "" ).replace( /^#/ , "" ) ||
- this.options.idPrefix + getNextTabId();
+ "ui-tabs-" + getNextTabId();
},
_sanitizeSelector: function( hash ) {
selector = "#" + id;
panel = self.element.find( selector );
if ( !panel.length ) {
- panel = $( self.options.panelTemplate )
- .attr( "id", id )
- .addClass( "ui-tabs-panel ui-widget-content ui-corner-bottom" )
- .data( "destroy.tabs", true )
- .insertAfter( self.panels[ i - 1 ] || self.list );
+ panel = self._createPanel( id );
+ panel.insertAfter( self.panels[ i - 1 ] || self.list );
}
// invalid tab href
} else {
});
},
+ _createPanel: function( id ) {
+ return $( "<div></div>" )
+ .attr( "id", id )
+ .addClass( "ui-tabs-panel ui-widget-content ui-corner-bottom" )
+ .data( "destroy.tabs", true );
+ },
+
_setupFx: function( fx ) {
// set up animations
if ( fx ) {
(function( $, prototype ) {
$.extend( prototype.options, {
add: null,
- remove: null
+ remove: null,
+ tabTemplate: "<li><a href='#{href}'><span>#{label}</span></a></li>"
});
prototype.add = function( url, label, index ) {
// try to find an existing element before creating a new one
var $panel = self.element.find( "#" + id );
if ( !$panel.length ) {
- $panel = $( o.panelTemplate )
- .attr( "id", id )
- .data( "destroy.tabs", true );
+ $panel = self._createPanel( id );
}
$panel.addClass( "ui-tabs-panel ui-widget-content ui-corner-bottom ui-tabs-hide" );
// _tabId method
(function( $, prototype ) {
+ $.extend( prototype.options, {
+ idPrefix: "ui-tabs-"
+ });
+
var _tabId = prototype._tabId;
prototype._tabId = function( a ) {
- return a.title && a.title.replace( /\s/g, "_" ).replace( /[^\w\u00c0-\uFFFF-]/g, "" ) ||
- _tabId.apply( this, arguments );
+ return ( $( a ).attr( "aria-controls" ) || "" ).replace( /^#/ , "" ) ||
+ a.title && a.title.replace( /\s/g, "_" ).replace( /[^\w\u00c0-\uFFFF-]/g, "" ) ||
+ this.options.idPrefix + getNextTabId();
+ };
+ }( jQuery, jQuery.ui.tabs.prototype ) );
+
+ // _tabId method
+ (function( $, prototype ) {
+ $.extend( prototype.options, {
+ panelTemplate: "<div></div>"
+ });
+
+ var _createPanel = prototype._createPanel;
+ prototype._createPanel = function( id ) {
+ return $( this.options.panelTemplate )
+ .attr( "id", id )
+ .addClass( "ui-tabs-panel ui-widget-content ui-corner-bottom" )
+ .data( "destroy.tabs", true );
};
}( jQuery, jQuery.ui.tabs.prototype ) );
}