mirror of
https://github.com/jquery/jquery-ui.git
synced 2024-11-21 11:04:24 +00:00
Tabs: Added tests for cache option. Fixes #7131 - Tabs: Add beforeload event; deprecate ajaxOptions and cache options.
This commit is contained in:
parent
9549686cb3
commit
7157af2550
@ -41,8 +41,34 @@ asyncTest( "ajaxOptions", function() {
|
||||
element.tabs( "option", "active", 2 );
|
||||
});
|
||||
|
||||
test('cache', function() {
|
||||
ok(false, "missing test - untested code is broken code.");
|
||||
asyncTest( "cache", function() {
|
||||
expect( 5 );
|
||||
|
||||
var element = $( "#tabs2" ).tabs({
|
||||
cache: true
|
||||
});
|
||||
element.one( "tabsshow", function( event, ui ) {
|
||||
tabs_state( element, 0, 0, 1, 0, 0 );
|
||||
});
|
||||
element.one( "tabsload", function( event, ui ) {
|
||||
ok( true, "tabsload" );
|
||||
|
||||
setTimeout(function() {
|
||||
element.tabs( "option", "active", 0 );
|
||||
tabs_state( element, 1, 0, 0, 0, 0 );
|
||||
|
||||
element.one( "tabsshow", function( event, ui ) {
|
||||
tabs_state( element, 0, 0, 1, 0, 0 );
|
||||
});
|
||||
element.one( "tabsload", function( event, ui ) {
|
||||
ok( false, "should be cached" );
|
||||
});
|
||||
element.tabs( "option", "active", 2 );
|
||||
start();
|
||||
}, 1 );
|
||||
});
|
||||
element.tabs( "option", "active", 2 );
|
||||
tabs_state( element, 0, 0, 1, 0, 0 );
|
||||
});
|
||||
|
||||
test( "idPrefix", function() {
|
||||
|
2
ui/jquery.ui.tabs.js
vendored
2
ui/jquery.ui.tabs.js
vendored
@ -705,7 +705,7 @@ if ( $.uiBackCompat !== false ) {
|
||||
}
|
||||
});
|
||||
|
||||
ui.jqXHR.success( function() {
|
||||
ui.jqXHR.success(function() {
|
||||
if ( self.options.cache ) {
|
||||
$.data( ui.tab[ 0 ], "cache.tabs", true );
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user