2011-03-26 19:00:39 +00:00
|
|
|
|
(function( $ ) {
|
|
|
|
|
|
2012-04-19 16:53:06 +00:00
|
|
|
|
var state = TestHelpers.tabs.state;
|
|
|
|
|
|
2011-05-10 13:15:08 +00:00
|
|
|
|
module( "tabs (deprecated): core" );
|
2011-03-27 02:14:17 +00:00
|
|
|
|
|
2011-04-06 01:39:02 +00:00
|
|
|
|
test( "panel ids", function() {
|
|
|
|
|
expect( 2 );
|
|
|
|
|
|
|
|
|
|
var element = $( "#tabs2" ).tabs();
|
|
|
|
|
|
|
|
|
|
element.one( "tabsbeforeload", function( event, ui ) {
|
|
|
|
|
equal( ui.panel.attr( "id" ), "∫ßáö_Սե", "from title attribute" );
|
|
|
|
|
event.preventDefault();
|
|
|
|
|
});
|
2011-04-07 17:53:20 +00:00
|
|
|
|
element.tabs( "option", "active", 4 );
|
2011-04-06 01:39:02 +00:00
|
|
|
|
|
|
|
|
|
element.one( "tabsbeforeload", function( event, ui ) {
|
|
|
|
|
ok( /^ui-tabs-\d+$/.test( ui.panel.attr( "id" ) ), "generated id" );
|
|
|
|
|
event.preventDefault();
|
2011-03-27 02:14:17 +00:00
|
|
|
|
});
|
2011-04-06 01:39:02 +00:00
|
|
|
|
element.tabs( "option", "active", 2 );
|
2011-03-27 02:14:17 +00:00
|
|
|
|
});
|
|
|
|
|
|
2011-05-09 15:31:01 +00:00
|
|
|
|
module( "tabs (deprecated): options" );
|
2011-03-26 19:00:39 +00:00
|
|
|
|
|
2011-05-09 18:45:57 +00:00
|
|
|
|
asyncTest( "ajaxOptions", function() {
|
2012-08-17 13:08:07 +00:00
|
|
|
|
expect( 2 );
|
2011-05-09 18:45:57 +00:00
|
|
|
|
|
|
|
|
|
var element = $( "#tabs2" ).tabs({
|
|
|
|
|
ajaxOptions: {
|
2012-08-17 13:08:07 +00:00
|
|
|
|
data: "foo=bar",
|
2011-05-09 18:45:57 +00:00
|
|
|
|
converters: {
|
|
|
|
|
"text html": function() {
|
|
|
|
|
return "test";
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
});
|
2012-08-17 13:08:07 +00:00
|
|
|
|
element.one( "tabsbeforeload", function( event, ui ) {
|
|
|
|
|
equal( ui.ajaxSettings.url.replace( /^[^\?]+/, "" ), "?foo=bar", "ajaxOptions.data" );
|
|
|
|
|
});
|
2011-05-09 18:45:57 +00:00
|
|
|
|
element.one( "tabsload", function( event, ui ) {
|
2012-02-28 14:56:32 +00:00
|
|
|
|
equal( $( ui.panel ).html(), "test" );
|
2011-05-09 18:45:57 +00:00
|
|
|
|
start();
|
|
|
|
|
});
|
|
|
|
|
element.tabs( "option", "active", 2 );
|
2011-03-26 19:00:39 +00:00
|
|
|
|
});
|
|
|
|
|
|
2011-05-09 19:04:01 +00:00
|
|
|
|
asyncTest( "cache", function() {
|
|
|
|
|
expect( 5 );
|
|
|
|
|
|
|
|
|
|
var element = $( "#tabs2" ).tabs({
|
|
|
|
|
cache: true
|
|
|
|
|
});
|
2012-10-23 02:37:42 +00:00
|
|
|
|
element.one( "tabsshow", function() {
|
2012-04-19 16:53:06 +00:00
|
|
|
|
state( element, 0, 0, 1, 0, 0 );
|
2011-05-09 19:04:01 +00:00
|
|
|
|
});
|
2012-10-23 02:37:42 +00:00
|
|
|
|
element.one( "tabsload", function() {
|
2011-05-09 19:04:01 +00:00
|
|
|
|
ok( true, "tabsload" );
|
|
|
|
|
|
|
|
|
|
setTimeout(function() {
|
|
|
|
|
element.tabs( "option", "active", 0 );
|
2012-04-19 16:53:06 +00:00
|
|
|
|
state( element, 1, 0, 0, 0, 0 );
|
2012-02-28 14:56:32 +00:00
|
|
|
|
|
2012-10-23 02:37:42 +00:00
|
|
|
|
element.one( "tabsshow", function() {
|
2012-04-19 16:53:06 +00:00
|
|
|
|
state( element, 0, 0, 1, 0, 0 );
|
2011-05-09 19:04:01 +00:00
|
|
|
|
});
|
2012-10-23 02:37:42 +00:00
|
|
|
|
element.one( "tabsload", function() {
|
2011-05-09 19:04:01 +00:00
|
|
|
|
ok( false, "should be cached" );
|
|
|
|
|
});
|
|
|
|
|
element.tabs( "option", "active", 2 );
|
|
|
|
|
start();
|
|
|
|
|
}, 1 );
|
|
|
|
|
});
|
|
|
|
|
element.tabs( "option", "active", 2 );
|
2012-04-19 16:53:06 +00:00
|
|
|
|
state( element, 0, 0, 1, 0, 0 );
|
2011-03-26 19:00:39 +00:00
|
|
|
|
});
|
|
|
|
|
|
2011-05-09 15:31:01 +00:00
|
|
|
|
test( "idPrefix", function() {
|
|
|
|
|
expect( 1 );
|
2011-03-27 19:12:53 +00:00
|
|
|
|
|
2011-05-09 15:31:01 +00:00
|
|
|
|
$( "#tabs2" )
|
|
|
|
|
.one( "tabsbeforeload", function( event, ui ) {
|
|
|
|
|
ok( /^testing-\d+$/.test( ui.panel.attr( "id" ) ), "generated id" );
|
|
|
|
|
event.preventDefault();
|
|
|
|
|
})
|
|
|
|
|
.tabs({
|
|
|
|
|
idPrefix: "testing-",
|
|
|
|
|
active: 2
|
|
|
|
|
});
|
2011-03-27 19:12:53 +00:00
|
|
|
|
});
|
|
|
|
|
|
2011-05-09 15:31:01 +00:00
|
|
|
|
test( "tabTemplate + panelTemplate", function() {
|
|
|
|
|
// defaults are tested in the add method test
|
|
|
|
|
expect( 11 );
|
|
|
|
|
|
2012-04-19 02:36:15 +00:00
|
|
|
|
var tab, anchor,
|
|
|
|
|
element = $( "#tabs2" ).tabs({
|
|
|
|
|
tabTemplate: "<li class='customTab'><a href='http://example.com/#{href}'>#{label}</a></li>",
|
|
|
|
|
panelTemplate: "<div class='customPanel'></div>"
|
|
|
|
|
});
|
2011-05-09 15:31:01 +00:00
|
|
|
|
element.one( "tabsadd", function( event, ui ) {
|
|
|
|
|
var anchor = $( ui.tab );
|
|
|
|
|
equal( ui.index, 5, "ui.index" );
|
|
|
|
|
equal( anchor.text(), "New", "ui.tab" );
|
|
|
|
|
equal( anchor.attr( "href" ), "http://example.com/#new", "tab href" );
|
|
|
|
|
ok( anchor.parent().hasClass( "customTab" ), "tab custom class" );
|
|
|
|
|
equal( ui.panel.id, "new", "ui.panel" );
|
|
|
|
|
ok( $( ui.panel ).hasClass( "customPanel" ), "panel custom class" );
|
|
|
|
|
});
|
|
|
|
|
element.tabs( "add", "#new", "New" );
|
2012-04-19 02:36:15 +00:00
|
|
|
|
tab = element.find( ".ui-tabs-nav li" ).last();
|
2012-05-18 20:11:14 +00:00
|
|
|
|
anchor = tab.find( ".ui-tabs-anchor" );
|
2012-02-28 14:56:32 +00:00
|
|
|
|
equal( tab.text(), "New", "label" );
|
2011-05-09 15:31:01 +00:00
|
|
|
|
ok( tab.hasClass( "customTab" ), "tab custom class" );
|
2012-02-28 14:56:32 +00:00
|
|
|
|
equal( anchor.attr( "href" ), "http://example.com/#new", "href" );
|
2012-05-18 20:11:14 +00:00
|
|
|
|
equal( tab.attr( "aria-controls" ), "new", "aria-controls" );
|
2011-05-09 15:31:01 +00:00
|
|
|
|
ok( element.find( "#new" ).hasClass( "customPanel" ), "panel custom class" );
|
2011-03-27 19:12:53 +00:00
|
|
|
|
});
|
|
|
|
|
|
2011-05-10 13:15:08 +00:00
|
|
|
|
test( "cookie", function() {
|
|
|
|
|
expect( 6 );
|
2011-03-29 02:46:31 +00:00
|
|
|
|
|
2011-05-10 13:15:08 +00:00
|
|
|
|
var element = $( "#tabs1" ),
|
|
|
|
|
cookieName = "tabs_test",
|
|
|
|
|
cookieObj = { name: cookieName };
|
|
|
|
|
$.cookie( cookieName, null );
|
|
|
|
|
function cookie() {
|
|
|
|
|
return parseInt( $.cookie( cookieName ), 10 );
|
|
|
|
|
}
|
2011-03-29 02:46:31 +00:00
|
|
|
|
|
2011-05-10 13:15:08 +00:00
|
|
|
|
element.tabs({ cookie: cookieObj });
|
2012-02-28 14:56:32 +00:00
|
|
|
|
equal( cookie(), 0, "initial cookie value" );
|
2011-03-29 02:46:31 +00:00
|
|
|
|
|
2011-05-10 13:15:08 +00:00
|
|
|
|
element.tabs( "destroy" );
|
|
|
|
|
element.tabs({ active: 1, cookie: cookieObj });
|
2012-02-28 14:56:32 +00:00
|
|
|
|
equal( cookie(), 1, "initial cookie value, from active property" );
|
2011-03-29 02:46:31 +00:00
|
|
|
|
|
2011-05-10 13:15:08 +00:00
|
|
|
|
element.tabs( "option", "active", 2 );
|
2012-02-28 14:56:32 +00:00
|
|
|
|
equal( cookie(), 2, "cookie value updated after activating" );
|
2011-03-29 02:46:31 +00:00
|
|
|
|
|
2011-05-10 13:15:08 +00:00
|
|
|
|
element.tabs( "destroy" );
|
|
|
|
|
$.cookie( cookieName, 1 );
|
|
|
|
|
element.tabs({ cookie: cookieObj });
|
2012-02-28 14:56:32 +00:00
|
|
|
|
equal( cookie(), 1, "initial cookie value, from existing cookie" );
|
2011-03-29 02:46:31 +00:00
|
|
|
|
|
2011-05-10 13:15:08 +00:00
|
|
|
|
element.tabs( "destroy" );
|
|
|
|
|
element.tabs({ cookie: cookieObj, collapsible: true });
|
|
|
|
|
element.tabs( "option", "active", false );
|
2012-02-28 14:56:32 +00:00
|
|
|
|
equal( cookie(), -1, "cookie value for all tabs unselected" );
|
2011-03-29 02:46:31 +00:00
|
|
|
|
|
2011-05-10 13:15:08 +00:00
|
|
|
|
element.tabs( "destroy" );
|
|
|
|
|
ok( $.cookie( cookieName ) === null, "erase cookie after destroy" );
|
2011-03-29 02:46:31 +00:00
|
|
|
|
});
|
|
|
|
|
|
2011-05-09 16:52:00 +00:00
|
|
|
|
asyncTest( "spinner", function() {
|
|
|
|
|
expect( 2 );
|
|
|
|
|
|
|
|
|
|
var element = $( "#tabs2" ).tabs();
|
2011-03-29 02:46:31 +00:00
|
|
|
|
|
2012-10-23 02:37:42 +00:00
|
|
|
|
element.one( "tabsbeforeload", function() {
|
2012-02-28 14:56:32 +00:00
|
|
|
|
equal( element.find( ".ui-tabs-nav li:eq(2) em" ).length, 1, "beforeload" );
|
2011-05-09 16:52:00 +00:00
|
|
|
|
});
|
2012-10-23 02:37:42 +00:00
|
|
|
|
element.one( "tabsload", function() {
|
2011-05-09 20:04:33 +00:00
|
|
|
|
// wait until after the load finishes before checking for the spinner to be removed
|
|
|
|
|
setTimeout(function() {
|
2012-02-28 14:56:32 +00:00
|
|
|
|
equal( element.find( ".ui-tabs-nav li:eq(2) em" ).length, 0, "load" );
|
2011-05-09 20:04:33 +00:00
|
|
|
|
start();
|
|
|
|
|
}, 1 );
|
2011-03-26 19:48:53 +00:00
|
|
|
|
});
|
2011-05-09 16:52:00 +00:00
|
|
|
|
element.tabs( "option", "active", 2 );
|
2011-03-26 19:48:53 +00:00
|
|
|
|
});
|
|
|
|
|
|
2011-05-03 11:14:19 +00:00
|
|
|
|
test( "selected", function() {
|
|
|
|
|
expect( 19 );
|
|
|
|
|
|
|
|
|
|
var element = $( "#tabs1" ).tabs();
|
2012-02-28 14:56:32 +00:00
|
|
|
|
equal( element.tabs( "option", "selected" ), 0, "should be 0 by default" );
|
2012-04-19 16:53:06 +00:00
|
|
|
|
state( element, 1, 0, 0 );
|
2011-05-03 11:14:19 +00:00
|
|
|
|
element.tabs( "destroy" );
|
|
|
|
|
|
|
|
|
|
location.hash = "#fragment-3";
|
|
|
|
|
element = $( "#tabs1" ).tabs();
|
2012-02-28 14:56:32 +00:00
|
|
|
|
equal( element.tabs( "option", "selected" ), 2, "should be 2 based on URL" );
|
2012-04-19 16:53:06 +00:00
|
|
|
|
state( element, 0, 0, 1 );
|
2011-05-03 11:14:19 +00:00
|
|
|
|
element.tabs( "destroy" );
|
|
|
|
|
|
|
|
|
|
el = $('#tabs1').tabs({
|
|
|
|
|
selected: -1,
|
|
|
|
|
collapsible: true
|
|
|
|
|
});
|
2012-04-19 16:53:06 +00:00
|
|
|
|
state( element, 0, 0, 0 );
|
2012-04-23 18:25:23 +00:00
|
|
|
|
equal( element.find( ".ui-tabs-nav .ui-state-active" ).length, 0, "no tabs selected" );
|
2011-05-03 11:14:19 +00:00
|
|
|
|
strictEqual( element.tabs( "option", "selected" ), -1 );
|
2011-03-27 20:37:43 +00:00
|
|
|
|
|
2011-05-03 11:14:19 +00:00
|
|
|
|
element.tabs( "option", "collapsible", false );
|
2012-04-19 16:53:06 +00:00
|
|
|
|
state( element, 1, 0, 0 );
|
2011-05-03 11:14:19 +00:00
|
|
|
|
equal( element.tabs( "option", "selected" ), 0 );
|
|
|
|
|
element.tabs( "destroy" );
|
2011-03-27 20:37:43 +00:00
|
|
|
|
|
2011-05-03 11:14:19 +00:00
|
|
|
|
element.tabs({
|
|
|
|
|
selected: -1
|
|
|
|
|
});
|
2012-04-19 16:53:06 +00:00
|
|
|
|
state( element, 1, 0, 0 );
|
2011-05-03 11:14:19 +00:00
|
|
|
|
strictEqual( element.tabs( "option", "selected" ), 0 );
|
|
|
|
|
element.tabs( "destroy" );
|
2011-03-27 20:37:43 +00:00
|
|
|
|
|
2011-05-03 11:14:19 +00:00
|
|
|
|
element.tabs({ selected: 2 });
|
2012-02-28 14:56:32 +00:00
|
|
|
|
equal( element.tabs( "option", "selected" ), 2 );
|
2012-04-19 16:53:06 +00:00
|
|
|
|
state( element, 0, 0, 1 );
|
2011-03-27 20:37:43 +00:00
|
|
|
|
|
2011-05-03 11:14:19 +00:00
|
|
|
|
element.tabs( "option", "selected", 0 );
|
2012-02-28 14:56:32 +00:00
|
|
|
|
equal( element.tabs( "option", "selected" ), 0 );
|
2012-04-19 16:53:06 +00:00
|
|
|
|
state( element, 1, 0, 0 );
|
2011-03-27 20:37:43 +00:00
|
|
|
|
|
2012-05-18 20:11:14 +00:00
|
|
|
|
element.find( ".ui-tabs-nav .ui-tabs-anchor" ).eq( 1 ).click();
|
2012-02-28 14:56:32 +00:00
|
|
|
|
equal( element.tabs( "option", "selected" ), 1 );
|
2012-04-19 16:53:06 +00:00
|
|
|
|
state( element, 0, 1, 0 );
|
2011-03-27 20:37:43 +00:00
|
|
|
|
|
2011-05-03 11:14:19 +00:00
|
|
|
|
element.tabs( "option", "selected", 10 );
|
2012-02-28 14:56:32 +00:00
|
|
|
|
equal( element.tabs( "option", "selected" ), 1 );
|
2012-04-19 16:53:06 +00:00
|
|
|
|
state( element, 0, 1, 0 );
|
2011-03-27 20:37:43 +00:00
|
|
|
|
|
2011-05-03 11:14:19 +00:00
|
|
|
|
location.hash = "#";
|
2011-03-27 20:37:43 +00:00
|
|
|
|
});
|
|
|
|
|
|
2011-05-03 10:31:12 +00:00
|
|
|
|
module( "tabs (deprecated): events" );
|
2011-03-26 20:12:05 +00:00
|
|
|
|
|
2011-05-17 19:46:41 +00:00
|
|
|
|
asyncTest( "load", function() {
|
|
|
|
|
expect( 15 );
|
|
|
|
|
|
2012-05-18 20:11:14 +00:00
|
|
|
|
var tab, anchor, panelId, panel,
|
2011-05-17 19:46:41 +00:00
|
|
|
|
element = $( "#tabs2" );
|
|
|
|
|
|
|
|
|
|
// init
|
|
|
|
|
element.one( "tabsload", function( event, ui ) {
|
2012-05-18 20:11:14 +00:00
|
|
|
|
tab = element.find( ".ui-tabs-nav li" ).eq( 2 );
|
|
|
|
|
anchor = tab.find( ".ui-tabs-anchor" );
|
2011-05-17 19:46:41 +00:00
|
|
|
|
panelId = tab.attr( "aria-controls" );
|
|
|
|
|
panel = $( "#" + panelId );
|
|
|
|
|
|
|
|
|
|
ok( !( "originalEvent" in event ), "originalEvent" );
|
2012-05-18 20:11:14 +00:00
|
|
|
|
strictEqual( ui.tab, anchor[ 0 ], "tab" );
|
2011-05-17 19:46:41 +00:00
|
|
|
|
strictEqual( ui.panel, panel[ 0 ], "panel" );
|
2012-02-28 14:56:32 +00:00
|
|
|
|
equal( $( ui.panel ).find( "p" ).length, 1, "panel html" );
|
2012-04-19 16:53:06 +00:00
|
|
|
|
state( element, 0, 0, 1, 0, 0 );
|
2011-05-17 19:46:41 +00:00
|
|
|
|
tabsload1();
|
|
|
|
|
});
|
|
|
|
|
element.tabs({ active: 2 });
|
|
|
|
|
|
|
|
|
|
function tabsload1() {
|
|
|
|
|
// .option()
|
|
|
|
|
element.one( "tabsload", function( event, ui ) {
|
2012-05-18 20:11:14 +00:00
|
|
|
|
tab = element.find( ".ui-tabs-nav li" ).eq( 3 );
|
|
|
|
|
anchor = tab.find( ".ui-tabs-anchor" );
|
2011-05-17 19:46:41 +00:00
|
|
|
|
panelId = tab.attr( "aria-controls" );
|
|
|
|
|
panel = $( "#" + panelId );
|
|
|
|
|
|
|
|
|
|
ok( !( "originalEvent" in event ), "originalEvent" );
|
2012-05-18 20:11:14 +00:00
|
|
|
|
strictEqual( ui.tab, anchor[ 0 ], "tab" );
|
2011-05-17 19:46:41 +00:00
|
|
|
|
strictEqual( ui.panel, panel[ 0 ], "panel" );
|
2012-02-28 14:56:32 +00:00
|
|
|
|
equal( $( ui.panel ).find( "p" ).length, 1, "panel html" );
|
2012-04-19 16:53:06 +00:00
|
|
|
|
state( element, 0, 0, 0, 1, 0 );
|
2011-05-17 19:46:41 +00:00
|
|
|
|
tabsload2();
|
|
|
|
|
});
|
|
|
|
|
element.tabs( "option", "active", 3 );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function tabsload2() {
|
|
|
|
|
// click, change panel content
|
|
|
|
|
element.one( "tabsload", function( event, ui ) {
|
2012-05-18 20:11:14 +00:00
|
|
|
|
tab = element.find( ".ui-tabs-nav li" ).eq( 4 );
|
|
|
|
|
anchor = tab.find( ".ui-tabs-anchor" );
|
2011-05-17 19:46:41 +00:00
|
|
|
|
panelId = tab.attr( "aria-controls" );
|
|
|
|
|
panel = $( "#" + panelId );
|
|
|
|
|
|
2012-02-28 14:56:32 +00:00
|
|
|
|
equal( event.originalEvent.type, "click", "originalEvent" );
|
2012-05-18 20:11:14 +00:00
|
|
|
|
strictEqual( ui.tab, anchor[ 0 ], "tab" );
|
2011-05-17 19:46:41 +00:00
|
|
|
|
strictEqual( ui.panel, panel[ 0 ], "panel" );
|
2012-02-28 14:56:32 +00:00
|
|
|
|
equal( $( ui.panel ).find( "p" ).length, 1, "panel html" );
|
2012-04-19 16:53:06 +00:00
|
|
|
|
state( element, 0, 0, 0, 0, 1 );
|
2011-05-17 19:46:41 +00:00
|
|
|
|
start();
|
|
|
|
|
});
|
2012-05-18 20:11:14 +00:00
|
|
|
|
element.find( ".ui-tabs-nav .ui-tabs-anchor" ).eq( 4 ).click();
|
2011-05-17 19:46:41 +00:00
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
2011-05-03 10:31:12 +00:00
|
|
|
|
test( "enable", function() {
|
|
|
|
|
expect( 3 );
|
2011-03-26 20:12:05 +00:00
|
|
|
|
|
2011-05-03 10:31:12 +00:00
|
|
|
|
var element = $( "#tabs1" ).tabs({
|
2011-03-26 20:12:05 +00:00
|
|
|
|
disabled: [ 0, 1 ],
|
2012-02-01 21:59:26 +00:00
|
|
|
|
enable: function( event, ui ) {
|
2012-05-18 20:11:14 +00:00
|
|
|
|
equal( ui.tab, element.find( ".ui-tabs-nav .ui-tabs-anchor" )[ 1 ], "ui.tab" );
|
2012-02-28 14:56:32 +00:00
|
|
|
|
equal( ui.panel, element.find( ".ui-tabs-panel" )[ 1 ], "ui.panel" );
|
|
|
|
|
equal( ui.index, 1, "ui.index" );
|
2011-03-26 20:12:05 +00:00
|
|
|
|
}
|
|
|
|
|
});
|
2011-05-03 10:31:12 +00:00
|
|
|
|
element.tabs( "enable", 1 );
|
|
|
|
|
// shouldn't trigger event
|
|
|
|
|
element.tabs( "enable", 2 );
|
2011-03-26 20:12:05 +00:00
|
|
|
|
});
|
|
|
|
|
|
2011-05-03 10:31:12 +00:00
|
|
|
|
test( "disable", function() {
|
|
|
|
|
expect( 3 );
|
2011-03-26 20:12:05 +00:00
|
|
|
|
|
2011-05-03 10:31:12 +00:00
|
|
|
|
var element = $( "#tabs1" ).tabs({
|
2012-02-01 21:59:26 +00:00
|
|
|
|
disable: function( event, ui ) {
|
2012-05-18 20:11:14 +00:00
|
|
|
|
equal( ui.tab, element.find( ".ui-tabs-nav .ui-tabs-anchor" )[ 1 ], "ui.tab" );
|
2012-02-28 14:56:32 +00:00
|
|
|
|
equal( ui.panel, element.find( ".ui-tabs-panel" )[ 1 ], "ui.panel" );
|
|
|
|
|
equal( ui.index, 1, "ui.index" );
|
2011-03-26 20:12:05 +00:00
|
|
|
|
}
|
|
|
|
|
});
|
2011-05-03 10:31:12 +00:00
|
|
|
|
element.tabs( "disable", 1 );
|
|
|
|
|
// shouldn't trigger event
|
|
|
|
|
element.tabs( "disable", 1 );
|
2011-03-26 20:12:05 +00:00
|
|
|
|
});
|
|
|
|
|
|
2011-03-27 20:55:05 +00:00
|
|
|
|
|
2011-05-10 17:56:59 +00:00
|
|
|
|
test( "show", function() {
|
|
|
|
|
expect( 13 );
|
|
|
|
|
|
|
|
|
|
var element = $( "#tabs1" ).tabs({
|
|
|
|
|
active: false,
|
|
|
|
|
collapsible: true
|
|
|
|
|
}),
|
2012-05-18 20:11:14 +00:00
|
|
|
|
anchors = element.find( ".ui-tabs-nav .ui-tabs-anchor" ),
|
2011-05-10 17:56:59 +00:00
|
|
|
|
panels = element.find( ".ui-tabs-panel" );
|
|
|
|
|
|
|
|
|
|
// from collapsed
|
|
|
|
|
element.one( "tabsshow", function( event, ui ) {
|
|
|
|
|
ok( !( "originalEvent" in event ), "originalEvent" );
|
2012-05-18 20:11:14 +00:00
|
|
|
|
strictEqual( ui.tab, anchors[ 0 ], "ui.tab" );
|
2011-05-10 17:56:59 +00:00
|
|
|
|
strictEqual( ui.panel, panels[ 0 ], "ui.panel" );
|
2011-05-10 18:04:50 +00:00
|
|
|
|
equal( ui.index, 0, "ui.index" );
|
2012-04-19 16:53:06 +00:00
|
|
|
|
state( element, 1, 0, 0 );
|
2011-03-27 20:55:05 +00:00
|
|
|
|
});
|
2011-05-10 17:56:59 +00:00
|
|
|
|
element.tabs( "option", "active", 0 );
|
2012-04-19 16:53:06 +00:00
|
|
|
|
state( element, 1, 0, 0 );
|
2011-03-27 20:55:05 +00:00
|
|
|
|
|
2011-05-10 17:56:59 +00:00
|
|
|
|
// switching tabs
|
|
|
|
|
element.one( "tabsshow", function( event, ui ) {
|
2012-02-28 14:56:32 +00:00
|
|
|
|
equal( event.originalEvent.type, "click", "originalEvent" );
|
2012-05-18 20:11:14 +00:00
|
|
|
|
strictEqual( ui.tab, anchors[ 1 ], "ui.tab" );
|
2011-05-10 17:56:59 +00:00
|
|
|
|
strictEqual( ui.panel, panels[ 1 ], "ui.panel" );
|
2011-05-10 18:04:50 +00:00
|
|
|
|
equal( ui.index, 1, "ui.index" );
|
2012-04-19 16:53:06 +00:00
|
|
|
|
state( element, 0, 1, 0 );
|
2011-05-10 17:56:59 +00:00
|
|
|
|
});
|
2012-05-18 20:11:14 +00:00
|
|
|
|
anchors.eq( 1 ).click();
|
2012-04-19 16:53:06 +00:00
|
|
|
|
state( element, 0, 1, 0 );
|
2011-03-27 20:55:05 +00:00
|
|
|
|
|
2011-05-10 17:56:59 +00:00
|
|
|
|
// collapsing
|
2012-10-23 02:37:42 +00:00
|
|
|
|
element.one( "tabsshow", function() {
|
2011-05-10 17:56:59 +00:00
|
|
|
|
ok( false, "collapsing" );
|
|
|
|
|
});
|
|
|
|
|
element.tabs( "option", "active", false );
|
2012-04-19 16:53:06 +00:00
|
|
|
|
state( element, 0, 0, 0 );
|
2011-03-27 20:55:05 +00:00
|
|
|
|
});
|
|
|
|
|
|
2011-05-10 18:04:50 +00:00
|
|
|
|
test( "select", function() {
|
|
|
|
|
expect( 13 );
|
2011-03-27 21:02:58 +00:00
|
|
|
|
|
2011-05-10 18:04:50 +00:00
|
|
|
|
var element = $( "#tabs1" ).tabs({
|
|
|
|
|
active: false,
|
|
|
|
|
collapsible: true
|
|
|
|
|
}),
|
2012-05-18 20:11:14 +00:00
|
|
|
|
anchors = element.find( ".ui-tabs-nav .ui-tabs-anchor" ),
|
2011-05-10 18:04:50 +00:00
|
|
|
|
panels = element.find( ".ui-tabs-panel" );
|
|
|
|
|
|
|
|
|
|
// from collapsed
|
|
|
|
|
element.one( "tabsselect", function( event, ui ) {
|
|
|
|
|
ok( !( "originalEvent" in event ), "originalEvent" );
|
2012-05-18 20:11:14 +00:00
|
|
|
|
strictEqual( ui.tab, anchors[ 0 ], "ui.tab" );
|
2011-05-10 18:04:50 +00:00
|
|
|
|
strictEqual( ui.panel, panels[ 0 ], "ui.panel" );
|
|
|
|
|
equal( ui.index, 0, "ui.index" );
|
2012-04-19 16:53:06 +00:00
|
|
|
|
state( element, 0, 0, 0 );
|
2011-05-10 18:04:50 +00:00
|
|
|
|
});
|
|
|
|
|
element.tabs( "option", "active", 0 );
|
2012-04-19 16:53:06 +00:00
|
|
|
|
state( element, 1, 0, 0 );
|
2011-05-10 18:04:50 +00:00
|
|
|
|
|
|
|
|
|
// switching tabs
|
|
|
|
|
element.one( "tabsselect", function( event, ui ) {
|
2012-02-28 14:56:32 +00:00
|
|
|
|
equal( event.originalEvent.type, "click", "originalEvent" );
|
2012-05-18 20:11:14 +00:00
|
|
|
|
strictEqual( ui.tab, anchors[ 1 ], "ui.tab" );
|
2011-05-10 18:04:50 +00:00
|
|
|
|
strictEqual( ui.panel, panels[ 1 ], "ui.panel" );
|
|
|
|
|
equal( ui.index, 1, "ui.index" );
|
2012-04-19 16:53:06 +00:00
|
|
|
|
state( element, 1, 0, 0 );
|
2011-03-27 21:02:58 +00:00
|
|
|
|
});
|
2012-05-18 20:11:14 +00:00
|
|
|
|
anchors.eq( 1 ).click();
|
2012-04-19 16:53:06 +00:00
|
|
|
|
state( element, 0, 1, 0 );
|
2011-03-27 21:02:58 +00:00
|
|
|
|
|
2011-05-10 18:04:50 +00:00
|
|
|
|
// collapsing
|
2012-10-23 02:37:42 +00:00
|
|
|
|
element.one( "tabsselect", function() {
|
2011-05-10 18:04:50 +00:00
|
|
|
|
ok( false, "collapsing" );
|
|
|
|
|
});
|
|
|
|
|
element.tabs( "option", "active", false );
|
2012-04-19 16:53:06 +00:00
|
|
|
|
state( element, 0, 0, 0 );
|
2011-03-27 21:02:58 +00:00
|
|
|
|
});
|
|
|
|
|
|
2011-04-29 01:35:04 +00:00
|
|
|
|
module( "tabs (deprecated): methods" );
|
|
|
|
|
|
|
|
|
|
test( "add", function() {
|
2012-05-04 15:21:38 +00:00
|
|
|
|
expect( 28 );
|
2011-04-29 01:35:04 +00:00
|
|
|
|
|
2012-04-19 02:36:15 +00:00
|
|
|
|
var tab, anchor,
|
|
|
|
|
element = $( "#tabs1" ).tabs();
|
2012-05-04 15:21:38 +00:00
|
|
|
|
|
|
|
|
|
function stripLeadingSlash( str ) {
|
|
|
|
|
return str.substr( str.charAt( 0 ) === "/" ? 1 : 0 );
|
|
|
|
|
}
|
|
|
|
|
|
2012-04-19 16:53:06 +00:00
|
|
|
|
state( element, 1, 0, 0 );
|
2011-04-29 01:35:04 +00:00
|
|
|
|
|
|
|
|
|
// add without index
|
2011-04-29 02:12:59 +00:00
|
|
|
|
element.one( "tabsadd", function( event, ui ) {
|
|
|
|
|
equal( ui.index, 3, "ui.index" );
|
|
|
|
|
equal( $( ui.tab ).text(), "New", "ui.tab" );
|
|
|
|
|
equal( ui.panel.id, "new", "ui.panel" );
|
|
|
|
|
});
|
2011-04-29 01:35:04 +00:00
|
|
|
|
element.tabs( "add", "#new", "New" );
|
2012-04-19 16:53:06 +00:00
|
|
|
|
state( element, 1, 0, 0, 0 );
|
2012-04-19 02:36:15 +00:00
|
|
|
|
tab = element.find( ".ui-tabs-nav li" ).last();
|
2012-05-18 20:11:14 +00:00
|
|
|
|
anchor = tab.find( ".ui-tabs-anchor" );
|
2012-02-28 14:56:32 +00:00
|
|
|
|
equal( tab.text(), "New", "label" );
|
2012-05-04 15:21:38 +00:00
|
|
|
|
equal( stripLeadingSlash( anchor[0].pathname ), stripLeadingSlash( location.pathname ), "href pathname" );
|
|
|
|
|
equal( anchor[0].hash, "#new", "href hash" );
|
2012-05-18 20:11:14 +00:00
|
|
|
|
equal( tab.attr( "aria-controls" ), "new", "aria-controls" );
|
2011-04-29 01:35:04 +00:00
|
|
|
|
ok( !tab.hasClass( "ui-state-hover" ), "not hovered" );
|
|
|
|
|
anchor.simulate( "mouseover" );
|
|
|
|
|
ok( tab.hasClass( "ui-state-hover" ), "hovered" );
|
|
|
|
|
anchor.simulate( "click" );
|
2012-04-19 16:53:06 +00:00
|
|
|
|
state( element, 0, 0, 0, 1 );
|
2011-04-29 01:35:04 +00:00
|
|
|
|
|
|
|
|
|
// add remote tab with index
|
2011-04-29 02:12:59 +00:00
|
|
|
|
element.one( "tabsadd", function( event, ui ) {
|
|
|
|
|
equal( ui.index, 1, "ui.index" );
|
|
|
|
|
equal( $( ui.tab ).text(), "New Remote", "ui.tab" );
|
2012-05-18 20:11:14 +00:00
|
|
|
|
equal( ui.panel.id, $( ui.tab ).closest( "li" ).attr( "aria-controls" ), "ui.panel" );
|
2011-04-29 02:12:59 +00:00
|
|
|
|
});
|
2011-04-29 01:35:04 +00:00
|
|
|
|
element.tabs( "add", "data/test.html", "New Remote", 1 );
|
2012-04-19 16:53:06 +00:00
|
|
|
|
state( element, 0, 0, 0, 0, 1 );
|
2011-04-29 01:35:04 +00:00
|
|
|
|
tab = element.find( ".ui-tabs-nav li" ).eq( 1 );
|
2012-05-18 20:11:14 +00:00
|
|
|
|
anchor = tab.find( ".ui-tabs-anchor" );
|
2012-02-28 14:56:32 +00:00
|
|
|
|
equal( tab.text(), "New Remote", "label" );
|
2012-05-04 15:21:38 +00:00
|
|
|
|
equal( stripLeadingSlash( stripLeadingSlash(
|
|
|
|
|
anchor[0].pathname.replace( stripLeadingSlash( location.pathname ).split( "/" ).slice( 0, -1 ).join( "/" ), "" )
|
|
|
|
|
) ), "data/test.html", "href" );
|
2012-05-18 20:11:14 +00:00
|
|
|
|
ok( /^ui-tabs-\d+$/.test( tab.attr( "aria-controls" ) ), "aria controls" );
|
2011-04-29 01:35:04 +00:00
|
|
|
|
ok( !tab.hasClass( "ui-state-hover" ), "not hovered" );
|
|
|
|
|
anchor.simulate( "mouseover" );
|
|
|
|
|
ok( tab.hasClass( "ui-state-hover" ), "hovered" );
|
|
|
|
|
anchor.simulate( "click" );
|
2012-04-19 16:53:06 +00:00
|
|
|
|
state( element, 0, 1, 0, 0, 0 );
|
2011-04-29 01:35:04 +00:00
|
|
|
|
|
|
|
|
|
// add to empty tab set
|
|
|
|
|
element = $( "<div><ul></ul></div>" ).tabs();
|
2012-02-28 14:56:32 +00:00
|
|
|
|
equal( element.tabs( "option", "active" ), false, "active: false on init" );
|
2011-04-29 02:12:59 +00:00
|
|
|
|
element.one( "tabsadd", function( event, ui ) {
|
|
|
|
|
equal( ui.index, 0, "ui.index" );
|
|
|
|
|
equal( $( ui.tab ).text(), "First", "ui.tab" );
|
|
|
|
|
equal( ui.panel.id, "first", "ui.panel" );
|
|
|
|
|
});
|
2011-04-29 01:35:04 +00:00
|
|
|
|
element.tabs( "add", "#first", "First" );
|
2012-04-19 16:53:06 +00:00
|
|
|
|
state( element, 1 );
|
2012-02-28 14:56:32 +00:00
|
|
|
|
equal( element.tabs( "option", "active" ), 0, "active: 0 after add" );
|
2011-04-29 01:35:04 +00:00
|
|
|
|
});
|
2011-03-26 20:29:57 +00:00
|
|
|
|
|
2011-04-29 01:35:04 +00:00
|
|
|
|
test( "#5069 - ui.tabs.add creates two tab panels when using a full URL", function() {
|
|
|
|
|
expect( 2 );
|
2011-03-26 20:29:57 +00:00
|
|
|
|
|
2011-04-29 01:35:04 +00:00
|
|
|
|
var element = $( "#tabs2" ).tabs();
|
2012-02-28 14:56:32 +00:00
|
|
|
|
equal( element.children( "div" ).length, element.find( ".ui-tabs-nav li" ).length );
|
2011-04-29 01:35:04 +00:00
|
|
|
|
element.tabs( "add", "/new", "New" );
|
2012-02-28 14:56:32 +00:00
|
|
|
|
equal( element.children( "div" ).length, element.find( ".ui-tabs-nav li" ).length );
|
2011-03-26 20:29:57 +00:00
|
|
|
|
});
|
|
|
|
|
|
2011-04-29 01:35:04 +00:00
|
|
|
|
test( "remove", function() {
|
2011-04-29 02:12:59 +00:00
|
|
|
|
expect( 17 );
|
2011-03-26 20:29:57 +00:00
|
|
|
|
|
2011-04-29 01:35:04 +00:00
|
|
|
|
var element = $( "#tabs1" ).tabs({ active: 1 });
|
2012-04-19 16:53:06 +00:00
|
|
|
|
state( element, 0, 1, 0 );
|
2011-03-26 20:29:57 +00:00
|
|
|
|
|
2011-04-29 02:12:59 +00:00
|
|
|
|
element.one( "tabsremove", function( event, ui ) {
|
|
|
|
|
equal( ui.index, -1, "ui.index" );
|
|
|
|
|
equal( $( ui.tab ).text(), "2", "ui.tab" );
|
|
|
|
|
equal( ui.panel.id, "fragment-2", "ui.panel" );
|
|
|
|
|
});
|
2011-04-29 01:35:04 +00:00
|
|
|
|
element.tabs( "remove", 1 );
|
2012-04-19 16:53:06 +00:00
|
|
|
|
state( element, 0, 1 );
|
2012-02-28 14:56:32 +00:00
|
|
|
|
equal( element.tabs( "option", "active" ), 1 );
|
|
|
|
|
equal( element.find( ".ui-tabs-nav li a[href$='fragment-2']" ).length, 0,
|
2011-04-29 01:35:04 +00:00
|
|
|
|
"remove correct list item" );
|
2012-02-28 14:56:32 +00:00
|
|
|
|
equal( element.find( "#fragment-2" ).length, 0, "remove correct panel" );
|
2011-03-26 20:29:57 +00:00
|
|
|
|
|
2011-04-29 02:12:59 +00:00
|
|
|
|
element.one( "tabsremove", function( event, ui ) {
|
|
|
|
|
equal( ui.index, -1, "ui.index" );
|
|
|
|
|
equal( $( ui.tab ).text(), "3", "ui.tab" );
|
|
|
|
|
equal( ui.panel.id, "fragment-3", "ui.panel" );
|
|
|
|
|
});
|
2011-04-29 01:35:04 +00:00
|
|
|
|
element.tabs( "remove", 1 );
|
2012-04-19 16:53:06 +00:00
|
|
|
|
state( element, 1 );
|
2012-02-28 14:56:32 +00:00
|
|
|
|
equal( element.tabs( "option", "active"), 0 );
|
2011-03-26 20:29:57 +00:00
|
|
|
|
|
2011-04-29 02:12:59 +00:00
|
|
|
|
element.one( "tabsremove", function( event, ui ) {
|
|
|
|
|
equal( ui.index, -1, "ui.index" );
|
|
|
|
|
equal( $( ui.tab ).text(), "1", "ui.tab" );
|
|
|
|
|
equal( ui.panel.id, "fragment-1", "ui.panel" );
|
|
|
|
|
});
|
2011-04-29 01:35:04 +00:00
|
|
|
|
element.tabs( "remove", 0 );
|
2012-02-28 14:56:32 +00:00
|
|
|
|
equal( element.tabs( "option", "active" ), false );
|
2011-03-26 20:29:57 +00:00
|
|
|
|
});
|
|
|
|
|
|
2011-05-03 11:48:08 +00:00
|
|
|
|
test( "select", function() {
|
|
|
|
|
expect( 23 );
|
2011-03-29 02:28:59 +00:00
|
|
|
|
|
2011-05-03 11:48:08 +00:00
|
|
|
|
var element = $( "#tabs1" ).tabs();
|
2012-04-19 16:53:06 +00:00
|
|
|
|
state( element, 1, 0, 0 );
|
2011-05-03 11:48:08 +00:00
|
|
|
|
element.tabs( "select", 1 );
|
2012-04-19 16:53:06 +00:00
|
|
|
|
state( element, 0, 1, 0 );
|
2012-02-28 14:56:32 +00:00
|
|
|
|
equal( element.tabs( "option", "active" ), 1, "active" );
|
|
|
|
|
equal( element.tabs( "option", "selected" ), 1, "selected" );
|
2011-05-03 11:48:08 +00:00
|
|
|
|
element.tabs( "destroy" );
|
2011-03-29 02:28:59 +00:00
|
|
|
|
|
2011-05-03 11:48:08 +00:00
|
|
|
|
element.tabs({ collapsible: true });
|
2012-04-19 16:53:06 +00:00
|
|
|
|
state( element, 1, 0, 0 );
|
2011-05-03 11:48:08 +00:00
|
|
|
|
element.tabs( "select", 0 );
|
2012-04-19 16:53:06 +00:00
|
|
|
|
state( element, 0, 0, 0 );
|
2012-02-28 14:56:32 +00:00
|
|
|
|
equal( element.tabs( "option", "active" ), false, "active" );
|
|
|
|
|
equal( element.tabs( "option", "selected" ), -1, "selected" );
|
2011-05-03 11:48:08 +00:00
|
|
|
|
element.tabs( "destroy" );
|
2011-03-29 02:28:59 +00:00
|
|
|
|
|
2011-05-03 11:48:08 +00:00
|
|
|
|
element.tabs({ collapsible: true });
|
|
|
|
|
element.tabs( "select", -1 );
|
2012-04-19 16:53:06 +00:00
|
|
|
|
state( element, 0, 0, 0 );
|
2012-02-28 14:56:32 +00:00
|
|
|
|
equal( element.tabs( "option", "active" ), false, "active" );
|
|
|
|
|
equal( element.tabs( "option", "selected" ), -1, "selected" );
|
2011-05-03 11:48:08 +00:00
|
|
|
|
element.tabs( "destroy" );
|
2011-03-29 02:28:59 +00:00
|
|
|
|
|
2011-05-03 11:48:08 +00:00
|
|
|
|
element.tabs();
|
2012-04-19 16:53:06 +00:00
|
|
|
|
state( element, 1, 0, 0 );
|
2012-02-28 14:56:32 +00:00
|
|
|
|
equal( element.tabs( "option", "active" ), 0, "active" );
|
|
|
|
|
equal( element.tabs( "option", "selected" ), 0, "selected" );
|
2011-05-03 11:48:08 +00:00
|
|
|
|
element.tabs( "select", 0 );
|
2012-04-19 16:53:06 +00:00
|
|
|
|
state( element, 1, 0, 0 );
|
2012-02-28 14:56:32 +00:00
|
|
|
|
equal( element.tabs( "option", "active" ), 0, "active" );
|
|
|
|
|
equal( element.tabs( "option", "selected" ), 0, "selected" );
|
2011-05-03 11:48:08 +00:00
|
|
|
|
element.tabs( "select", -1 );
|
2012-04-19 16:53:06 +00:00
|
|
|
|
state( element, 1, 0, 0 );
|
2012-02-28 14:56:32 +00:00
|
|
|
|
equal( element.tabs( "option", "active" ), 0, "active" );
|
|
|
|
|
equal( element.tabs( "option", "selected" ), 0, "selected" );
|
2011-03-29 02:28:59 +00:00
|
|
|
|
|
2011-05-03 11:48:08 +00:00
|
|
|
|
element.tabs( "select", "#fragment-2" );
|
2012-04-19 16:53:06 +00:00
|
|
|
|
state( element, 0, 1, 0 );
|
2012-02-28 14:56:32 +00:00
|
|
|
|
equal( element.tabs( "option", "active" ), 1, "active" );
|
|
|
|
|
equal( element.tabs( "option", "selected" ), 1, "selected" );
|
2011-03-29 02:28:59 +00:00
|
|
|
|
});
|
|
|
|
|
|
2011-04-06 00:07:27 +00:00
|
|
|
|
test( "length", function() {
|
|
|
|
|
expect( 2 );
|
2011-03-26 20:29:57 +00:00
|
|
|
|
|
2012-02-28 14:56:32 +00:00
|
|
|
|
equal( $( "#tabs1" ).tabs().tabs( "length" ), 3, "basic tabs" );
|
|
|
|
|
equal( $( "#tabs2" ).tabs().tabs( "length" ), 5, "ajax tabs with missing panels" );
|
2011-03-26 20:29:57 +00:00
|
|
|
|
});
|
|
|
|
|
|
2011-04-06 01:39:02 +00:00
|
|
|
|
test( "url", function() {
|
|
|
|
|
expect( 2 );
|
2011-03-27 02:14:17 +00:00
|
|
|
|
|
2011-04-06 01:39:02 +00:00
|
|
|
|
var element = $( "#tabs2" ).tabs(),
|
2012-05-18 20:11:14 +00:00
|
|
|
|
anchor = element.find( ".ui-tabs-anchor" ).eq( 3 );
|
2011-04-06 01:39:02 +00:00
|
|
|
|
|
|
|
|
|
element.tabs( "url", 3, "data/test2.html" );
|
2012-05-18 20:11:14 +00:00
|
|
|
|
equal( anchor.attr( "href" ), "data/test2.html", "href was updated" );
|
2011-04-06 01:39:02 +00:00
|
|
|
|
element.one( "tabsbeforeload", function( event, ui ) {
|
2012-02-28 14:56:32 +00:00
|
|
|
|
equal( ui.ajaxSettings.url, "data/test2.html", "ajaxSettings.url" );
|
2011-04-06 01:39:02 +00:00
|
|
|
|
event.preventDefault();
|
|
|
|
|
});
|
|
|
|
|
element.tabs( "option", "active", 3 );
|
2011-03-27 02:14:17 +00:00
|
|
|
|
});
|
|
|
|
|
|
2011-05-09 20:54:51 +00:00
|
|
|
|
asyncTest( "abort", function() {
|
|
|
|
|
expect( 1 );
|
|
|
|
|
|
|
|
|
|
var element = $( "#tabs2" ).tabs();
|
|
|
|
|
element.one( "tabsbeforeload", function( event, ui ) {
|
|
|
|
|
ui.jqXHR.error(function( jqXHR, status ) {
|
2012-02-28 14:56:32 +00:00
|
|
|
|
equal( status, "abort", "aborted" );
|
2011-05-09 20:54:51 +00:00
|
|
|
|
start();
|
|
|
|
|
});
|
|
|
|
|
});
|
2012-05-04 15:21:38 +00:00
|
|
|
|
// prevent IE from caching the request, so that it won't resolve before we call abort
|
2012-05-18 20:11:14 +00:00
|
|
|
|
element.find( ".ui-tabs-nav li:eq(2) .ui-tabs-anchor" ).attr( "href", function( href ) {
|
2012-05-04 15:21:38 +00:00
|
|
|
|
return href + "?" + (+ new Date());
|
|
|
|
|
});
|
2011-05-09 20:54:51 +00:00
|
|
|
|
element.tabs( "option", "active", 2 );
|
|
|
|
|
element.tabs( "abort" );
|
2011-05-09 18:45:57 +00:00
|
|
|
|
});
|
|
|
|
|
|
2011-03-26 19:00:39 +00:00
|
|
|
|
}( jQuery ) );
|