aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorScott González <scott.gonzalez@gmail.com>2012-10-25 05:46:54 -0400
committerScott González <scott.gonzalez@gmail.com>2012-10-25 05:46:54 -0400
commita9053d93008e203391206cb743e873064fc8198b (patch)
tree27532f9816232bf7ae77d816e5291ada764b3c76
parentfb525e1cb10ce5959df28b0cbd29ebdc96c266f4 (diff)
downloadjquery-ui-a9053d93008e203391206cb743e873064fc8198b.tar.gz
jquery-ui-a9053d93008e203391206cb743e873064fc8198b.zip
Tabs: Removed selected option. Fixes #7152 - Tabs: Remove selected option.
-rw-r--r--tests/unit/tabs/tabs_deprecated.js53
-rw-r--r--ui/jquery.ui.tabs.js36
2 files changed, 0 insertions, 89 deletions
diff --git a/tests/unit/tabs/tabs_deprecated.js b/tests/unit/tabs/tabs_deprecated.js
index 10c86d254..9f0e320cc 100644
--- a/tests/unit/tabs/tabs_deprecated.js
+++ b/tests/unit/tabs/tabs_deprecated.js
@@ -84,59 +84,6 @@ asyncTest( "spinner", function() {
element.tabs( "option", "active", 2 );
});
-test( "selected", function() {
- expect( 19 );
-
- var element = $( "#tabs1" ).tabs();
- equal( element.tabs( "option", "selected" ), 0, "should be 0 by default" );
- state( element, 1, 0, 0 );
- element.tabs( "destroy" );
-
- location.hash = "#fragment-3";
- element = $( "#tabs1" ).tabs();
- equal( element.tabs( "option", "selected" ), 2, "should be 2 based on URL" );
- state( element, 0, 0, 1 );
- element.tabs( "destroy" );
-
- el = $('#tabs1').tabs({
- selected: -1,
- collapsible: true
- });
- state( element, 0, 0, 0 );
- equal( element.find( ".ui-tabs-nav .ui-state-active" ).length, 0, "no tabs selected" );
- strictEqual( element.tabs( "option", "selected" ), -1 );
-
- element.tabs( "option", "collapsible", false );
- state( element, 1, 0, 0 );
- equal( element.tabs( "option", "selected" ), 0 );
- element.tabs( "destroy" );
-
- element.tabs({
- selected: -1
- });
- state( element, 1, 0, 0 );
- strictEqual( element.tabs( "option", "selected" ), 0 );
- element.tabs( "destroy" );
-
- element.tabs({ selected: 2 });
- equal( element.tabs( "option", "selected" ), 2 );
- state( element, 0, 0, 1 );
-
- element.tabs( "option", "selected", 0 );
- equal( element.tabs( "option", "selected" ), 0 );
- state( element, 1, 0, 0 );
-
- element.find( ".ui-tabs-nav .ui-tabs-anchor" ).eq( 1 ).click();
- equal( element.tabs( "option", "selected" ), 1 );
- state( element, 0, 1, 0 );
-
- element.tabs( "option", "selected", 10 );
- equal( element.tabs( "option", "selected" ), 1 );
- state( element, 0, 1, 0 );
-
- location.hash = "#";
-});
-
module( "tabs (deprecated): events" );
asyncTest( "load", function() {
diff --git a/ui/jquery.ui.tabs.js b/ui/jquery.ui.tabs.js
index cc9e93b7d..09946072e 100644
--- a/ui/jquery.ui.tabs.js
+++ b/ui/jquery.ui.tabs.js
@@ -1010,42 +1010,6 @@ if ( $.uiBackCompat !== false ) {
}
});
- // selected option
- $.widget( "ui.tabs", $.ui.tabs, {
- _create: function() {
- var options = this.options;
- if ( options.active === null && options.selected !== undefined ) {
- options.active = options.selected === -1 ? false : options.selected;
- }
- this._super();
- options.selected = options.active;
- if ( options.selected === false ) {
- options.selected = -1;
- }
- },
-
- _setOption: function( key, value ) {
- if ( key !== "selected" ) {
- return this._super( key, value );
- }
-
- var options = this.options;
- this._super( "active", value === -1 ? false : value );
- options.selected = options.active;
- if ( options.selected === false ) {
- options.selected = -1;
- }
- },
-
- _eventHandler: function() {
- this._superApply( arguments );
- this.options.selected = this.options.active;
- if ( this.options.selected === false ) {
- this.options.selected = -1;
- }
- }
- });
-
// load event
$.widget( "ui.tabs", $.ui.tabs, {
_trigger: function( type, event, data ) {