Skip to content

Commit 52a184e

Browse files
committed
Tabs: Removed ajaxOptions and cache options. Fixes #7147 - Tabs: Remove ajaxOptions and cache options.
1 parent 974e5f8 commit 52a184e

File tree

3 files changed

+0
-120
lines changed

3 files changed

+0
-120
lines changed

tests/unit/tabs/tabs_common_deprecated.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
TestHelpers.commonWidgetTests( "tabs", {
22
defaults: {
33
active: null,
4-
ajaxOptions: null,
5-
cache: false,
64
collapsible: false,
75
cookie: null,
86
disabled: false,

tests/unit/tabs/tabs_deprecated.js

Lines changed: 0 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -24,59 +24,6 @@ test( "panel ids", function() {
2424

2525
module( "tabs (deprecated): options" );
2626

27-
asyncTest( "ajaxOptions", function() {
28-
expect( 2 );
29-
30-
var element = $( "#tabs2" ).tabs({
31-
ajaxOptions: {
32-
data: "foo=bar",
33-
converters: {
34-
"text html": function() {
35-
return "test";
36-
}
37-
}
38-
}
39-
});
40-
element.one( "tabsbeforeload", function( event, ui ) {
41-
equal( ui.ajaxSettings.url.replace( /^[^\?]+/, "" ), "?foo=bar", "ajaxOptions.data" );
42-
});
43-
element.one( "tabsload", function( event, ui ) {
44-
equal( $( ui.panel ).html(), "test" );
45-
start();
46-
});
47-
element.tabs( "option", "active", 2 );
48-
});
49-
50-
asyncTest( "cache", function() {
51-
expect( 5 );
52-
53-
var element = $( "#tabs2" ).tabs({
54-
cache: true
55-
});
56-
element.one( "tabsshow", function() {
57-
state( element, 0, 0, 1, 0, 0 );
58-
});
59-
element.one( "tabsload", function() {
60-
ok( true, "tabsload" );
61-
62-
setTimeout(function() {
63-
element.tabs( "option", "active", 0 );
64-
state( element, 1, 0, 0, 0, 0 );
65-
66-
element.one( "tabsshow", function() {
67-
state( element, 0, 0, 1, 0, 0 );
68-
});
69-
element.one( "tabsload", function() {
70-
ok( false, "should be cached" );
71-
});
72-
element.tabs( "option", "active", 2 );
73-
start();
74-
}, 1 );
75-
});
76-
element.tabs( "option", "active", 2 );
77-
state( element, 0, 0, 1, 0, 0 );
78-
});
79-
8027
test( "idPrefix", function() {
8128
expect( 1 );
8229

ui/jquery.ui.tabs.js

Lines changed: 0 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -825,7 +825,6 @@ $.widget( "ui.tabs", {
825825
}
826826
},
827827

828-
// TODO: Remove this function in 1.10 when ajaxOptions is removed
829828
_ajaxSettings: function( anchor, event, eventData ) {
830829
var that = this;
831830
return {
@@ -862,70 +861,6 @@ if ( $.uiBackCompat !== false ) {
862861
}
863862
});
864863

865-
// TODO: Remove _ajaxSettings() method when removing this extension
866-
// ajaxOptions and cache options
867-
$.widget( "ui.tabs", $.ui.tabs, {
868-
options: {
869-
ajaxOptions: null,
870-
cache: false
871-
},
872-
873-
_create: function() {
874-
this._super();
875-
876-
var that = this;
877-
878-
this._on({ tabsbeforeload: function( event, ui ) {
879-
// tab is already cached
880-
if ( $.data( ui.tab[ 0 ], "cache.tabs" ) ) {
881-
event.preventDefault();
882-
return;
883-
}
884-
885-
ui.jqXHR.success(function() {
886-
if ( that.options.cache ) {
887-
$.data( ui.tab[ 0 ], "cache.tabs", true );
888-
}
889-
});
890-
}});
891-
},
892-
893-
_ajaxSettings: function( anchor, event, ui ) {
894-
var ajaxOptions = this.options.ajaxOptions;
895-
return $.extend( {}, ajaxOptions, {
896-
error: function( xhr, status ) {
897-
try {
898-
// Passing index avoid a race condition when this method is
899-
// called after the user has selected another tab.
900-
// Pass the anchor that initiated this request allows
901-
// loadError to manipulate the tab content panel via $(a.hash)
902-
ajaxOptions.error(
903-
xhr, status, ui.tab.closest( "li" ).index(), ui.tab[ 0 ] );
904-
}
905-
catch ( error ) {}
906-
}
907-
}, this._superApply( arguments ) );
908-
},
909-
910-
_setOption: function( key, value ) {
911-
// reset cache if switching from cached to not cached
912-
if ( key === "cache" && value === false ) {
913-
this.anchors.removeData( "cache.tabs" );
914-
}
915-
this._super( key, value );
916-
},
917-
918-
_destroy: function() {
919-
this.anchors.removeData( "cache.tabs" );
920-
this._super();
921-
},
922-
923-
url: function( index ){
924-
this.anchors.eq( index ).removeData( "cache.tabs" );
925-
this._superApply( arguments );
926-
}
927-
});
928-
929864
// abort method
930865
$.widget( "ui.tabs", $.ui.tabs, {
931866
abort: function() {

0 commit comments

Comments
 (0)