]> source.dussan.org Git - jquery-ui.git/commitdiff
Tabs: Removed ajaxOptions and cache options. Fixes #7147 - Tabs: Remove ajaxOptions...
authorScott González <scott.gonzalez@gmail.com>
Thu, 25 Oct 2012 09:27:33 +0000 (05:27 -0400)
committerScott González <scott.gonzalez@gmail.com>
Thu, 25 Oct 2012 09:27:33 +0000 (05:27 -0400)
tests/unit/tabs/tabs_common_deprecated.js
tests/unit/tabs/tabs_deprecated.js
ui/jquery.ui.tabs.js

index 5b41014da6ec120d8954b3620cbcb9cc35b0352c..040e8cbf2fef3d1311834bb6d0a927a202080799 100644 (file)
@@ -1,8 +1,6 @@
 TestHelpers.commonWidgetTests( "tabs", {
        defaults: {
                active: null,
-               ajaxOptions: null,
-               cache: false,
                collapsible: false,
                cookie: null,
                disabled: false,
index 297a4546e0825067989b48b97be82de49d38377a..b3db097b97f1dc2ee7c5741a951e92a8569e44c6 100644 (file)
@@ -24,59 +24,6 @@ test( "panel ids", function() {
 
 module( "tabs (deprecated): options" );
 
-asyncTest( "ajaxOptions", function() {
-       expect( 2 );
-
-       var element = $( "#tabs2" ).tabs({
-               ajaxOptions: {
-                       data: "foo=bar",
-                       converters: {
-                               "text html": function() {
-                                       return "test";
-                               }
-                       }
-               }
-       });
-       element.one( "tabsbeforeload", function( event, ui ) {
-               equal( ui.ajaxSettings.url.replace( /^[^\?]+/, "" ), "?foo=bar", "ajaxOptions.data" );
-       });
-       element.one( "tabsload", function( event, ui ) {
-               equal( $( ui.panel ).html(), "test" );
-               start();
-       });
-       element.tabs( "option", "active", 2 );
-});
-
-asyncTest( "cache", function() {
-       expect( 5 );
-
-       var element = $( "#tabs2" ).tabs({
-               cache: true
-       });
-       element.one( "tabsshow", function() {
-               state( element, 0, 0, 1, 0, 0 );
-       });
-       element.one( "tabsload", function() {
-               ok( true, "tabsload" );
-
-               setTimeout(function() {
-                       element.tabs( "option", "active", 0 );
-                       state( element, 1, 0, 0, 0, 0 );
-
-                       element.one( "tabsshow", function() {
-                               state( element, 0, 0, 1, 0, 0 );
-                       });
-                       element.one( "tabsload", function() {
-                               ok( false, "should be cached" );
-                       });
-                       element.tabs( "option", "active", 2 );
-                       start();
-               }, 1 );
-       });
-       element.tabs( "option", "active", 2 );
-       state( element, 0, 0, 1, 0, 0 );
-});
-
 test( "idPrefix", function() {
        expect( 1 );
 
index 0d920c3a13771f4cf0affe4f059673b4190c807c..77dad0892fe81ef2ac950899f8085bf2f7b0a5d4 100644 (file)
@@ -825,7 +825,6 @@ $.widget( "ui.tabs", {
                }
        },
 
-       // TODO: Remove this function in 1.10 when ajaxOptions is removed
        _ajaxSettings: function( anchor, event, eventData ) {
                var that = this;
                return {
@@ -862,70 +861,6 @@ if ( $.uiBackCompat !== false ) {
                }
        });
 
-       // TODO: Remove _ajaxSettings() method when removing this extension
-       // ajaxOptions and cache options
-       $.widget( "ui.tabs", $.ui.tabs, {
-               options: {
-                       ajaxOptions: null,
-                       cache: false
-               },
-
-               _create: function() {
-                       this._super();
-
-                       var that = this;
-
-                       this._on({ tabsbeforeload: function( event, ui ) {
-                               // tab is already cached
-                               if ( $.data( ui.tab[ 0 ], "cache.tabs" ) ) {
-                                       event.preventDefault();
-                                       return;
-                               }
-
-                               ui.jqXHR.success(function() {
-                                       if ( that.options.cache ) {
-                                               $.data( ui.tab[ 0 ], "cache.tabs", true );
-                                       }
-                               });
-                       }});
-               },
-
-               _ajaxSettings: function( anchor, event, ui ) {
-                       var ajaxOptions = this.options.ajaxOptions;
-                       return $.extend( {}, ajaxOptions, {
-                               error: function( xhr, status ) {
-                                       try {
-                                               // Passing index avoid a race condition when this method is
-                                               // called after the user has selected another tab.
-                                               // Pass the anchor that initiated this request allows
-                                               // loadError to manipulate the tab content panel via $(a.hash)
-                                               ajaxOptions.error(
-                                                       xhr, status, ui.tab.closest( "li" ).index(), ui.tab[ 0 ] );
-                                       }
-                                       catch ( error ) {}
-                               }
-                       }, this._superApply( arguments ) );
-               },
-
-               _setOption: function( key, value ) {
-                       // reset cache if switching from cached to not cached
-                       if ( key === "cache" && value === false ) {
-                               this.anchors.removeData( "cache.tabs" );
-                       }
-                       this._super( key, value );
-               },
-
-               _destroy: function() {
-                       this.anchors.removeData( "cache.tabs" );
-                       this._super();
-               },
-
-               url: function( index ){
-                       this.anchors.eq( index ).removeData( "cache.tabs" );
-                       this._superApply( arguments );
-               }
-       });
-
        // abort method
        $.widget( "ui.tabs", $.ui.tabs, {
                abort: function() {