]> source.dussan.org Git - jquery-ui.git/commitdiff
Tabs: Removed enable and disable events. Fixes #7160 - Tabs: Remove enable and disabl...
authorScott González <scott.gonzalez@gmail.com>
Thu, 25 Oct 2012 09:39:15 +0000 (05:39 -0400)
committerScott González <scott.gonzalez@gmail.com>
Thu, 25 Oct 2012 09:39:15 +0000 (05:39 -0400)
tests/unit/tabs/tabs_common_deprecated.js
tests/unit/tabs/tabs_deprecated.js
ui/jquery.ui.tabs.js

index 72fecfbdd3e0e10464144dba62f25ccf6f032d66..2449a07d3ba4ca3f8f9ba6ac8dd70f93ad7b758a 100644 (file)
@@ -18,8 +18,6 @@ TestHelpers.commonWidgetTests( "tabs", {
                beforeActivate: null,
                beforeLoad: null,
                create: null,
-               disable: null,
-               enable: null,
                load: null,
                remove: null,
                select: null,
index 2de6128535b9b873ba2df7f61197c9823ffb484b..6e84accdf3207d740b4e97fb40340abf2799b8bd 100644 (file)
@@ -198,38 +198,6 @@ asyncTest( "load", function() {
        }
 });
 
-test( "enable", function() {
-       expect( 3 );
-
-       var element = $( "#tabs1" ).tabs({
-               disabled: [ 0, 1 ],
-               enable: function( event, ui ) {
-                       equal( ui.tab, element.find( ".ui-tabs-nav .ui-tabs-anchor" )[ 1 ], "ui.tab" );
-                       equal( ui.panel, element.find( ".ui-tabs-panel" )[ 1 ], "ui.panel" );
-                       equal( ui.index, 1, "ui.index" );
-               }
-       });
-       element.tabs( "enable", 1 );
-       // shouldn't trigger event
-       element.tabs( "enable", 2 );
-});
-
-test( "disable", function() {
-       expect( 3 );
-
-       var element = $( "#tabs1" ).tabs({
-               disable: function( event, ui ) {
-                       equal( ui.tab, element.find( ".ui-tabs-nav .ui-tabs-anchor" )[ 1 ], "ui.tab" );
-                       equal( ui.panel, element.find( ".ui-tabs-panel" )[ 1 ], "ui.panel" );
-                       equal( ui.index, 1, "ui.index" );
-               }
-       });
-       element.tabs( "disable", 1 );
-       // shouldn't trigger event
-       element.tabs( "disable", 1 );
-});
-
-
 test( "show", function() {
        expect( 13 );
 
index 5f6d87eee360d486af20977549e9d01b89f11c12..ed0ca1036abfd02a0a1895b9fb7c0ca6143827e9 100644 (file)
@@ -889,46 +889,6 @@ if ( $.uiBackCompat !== false ) {
                }
        });
 
-       // enable/disable events
-       $.widget( "ui.tabs", $.ui.tabs, {
-               options: {
-                       enable: null,
-                       disable: null
-               },
-
-               enable: function( index ) {
-                       var options = this.options,
-                               trigger;
-
-                       if ( index && options.disabled === true ||
-                                       ( $.isArray( options.disabled ) && $.inArray( index, options.disabled ) !== -1 ) ) {
-                               trigger = true;
-                       }
-
-                       this._superApply( arguments );
-
-                       if ( trigger ) {
-                               this._trigger( "enable", null, this._ui( this.anchors[ index ], this.panels[ index ] ) );
-                       }
-               },
-
-               disable: function( index ) {
-                       var options = this.options,
-                               trigger;
-
-                       if ( index && options.disabled === false ||
-                                       ( $.isArray( options.disabled ) && $.inArray( index, options.disabled ) === -1 ) ) {
-                               trigger = true;
-                       }
-
-                       this._superApply( arguments );
-
-                       if ( trigger ) {
-                               this._trigger( "disable", null, this._ui( this.anchors[ index ], this.panels[ index ] ) );
-                       }
-               }
-       });
-
        // add/remove methods and events
        $.widget( "ui.tabs", $.ui.tabs, {
                options: {