Skip to content

Commit a1fd49f

Browse files
committed
Tabs: Removed show event. Fixes #7155 - Tabs: Remove show event.
1 parent 7cf2719 commit a1fd49f

File tree

3 files changed

+3
-59
lines changed

3 files changed

+3
-59
lines changed

tests/unit/tabs/tabs_common_deprecated.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ TestHelpers.commonWidgetTests( "tabs", {
88
hide: null,
99
idPrefix: "ui-tabs-",
1010
panelTemplate: "<div></div>",
11-
// show: null, // conflicts with old show callback
11+
show: null,
1212
spinner: "<em>Loading&#8230;</em>",
1313
tabTemplate: "<li><a href='#{href}'><span>#{label}</span></a></li>",
1414

@@ -20,7 +20,6 @@ TestHelpers.commonWidgetTests( "tabs", {
2020
create: null,
2121
load: null,
2222
remove: null,
23-
select: null,
24-
show: null
23+
select: null
2524
}
2625
});

tests/unit/tabs/tabs_deprecated.js

Lines changed: 0 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -198,46 +198,6 @@ asyncTest( "load", function() {
198198
}
199199
});
200200

201-
test( "show", function() {
202-
expect( 13 );
203-
204-
var element = $( "#tabs1" ).tabs({
205-
active: false,
206-
collapsible: true
207-
}),
208-
anchors = element.find( ".ui-tabs-nav .ui-tabs-anchor" ),
209-
panels = element.find( ".ui-tabs-panel" );
210-
211-
// from collapsed
212-
element.one( "tabsshow", function( event, ui ) {
213-
ok( !( "originalEvent" in event ), "originalEvent" );
214-
strictEqual( ui.tab, anchors[ 0 ], "ui.tab" );
215-
strictEqual( ui.panel, panels[ 0 ], "ui.panel" );
216-
equal( ui.index, 0, "ui.index" );
217-
state( element, 1, 0, 0 );
218-
});
219-
element.tabs( "option", "active", 0 );
220-
state( element, 1, 0, 0 );
221-
222-
// switching tabs
223-
element.one( "tabsshow", function( event, ui ) {
224-
equal( event.originalEvent.type, "click", "originalEvent" );
225-
strictEqual( ui.tab, anchors[ 1 ], "ui.tab" );
226-
strictEqual( ui.panel, panels[ 1 ], "ui.panel" );
227-
equal( ui.index, 1, "ui.index" );
228-
state( element, 0, 1, 0 );
229-
});
230-
anchors.eq( 1 ).click();
231-
state( element, 0, 1, 0 );
232-
233-
// collapsing
234-
element.one( "tabsshow", function() {
235-
ok( false, "collapsing" );
236-
});
237-
element.tabs( "option", "active", false );
238-
state( element, 0, 0, 0 );
239-
});
240-
241201
test( "select", function() {
242202
expect( 13 );
243203

ui/jquery.ui.tabs.js

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1046,20 +1046,11 @@ if ( $.uiBackCompat !== false ) {
10461046
}
10471047
});
10481048

1049-
// show and select event
1049+
// select event
10501050
$.widget( "ui.tabs", $.ui.tabs, {
10511051
options: {
1052-
show: null,
10531052
select: null
10541053
},
1055-
_create: function() {
1056-
this._super();
1057-
if ( this.options.active !== false ) {
1058-
this._trigger( "show", null, this._ui(
1059-
this.active.find( ".ui-tabs-anchor" )[ 0 ],
1060-
this._getPanelForTab( this.active )[ 0 ] ) );
1061-
}
1062-
},
10631054
_trigger: function( type, event, data ) {
10641055
var ret = this._superApply( arguments );
10651056
if ( !ret ) {
@@ -1071,12 +1062,6 @@ if ( $.uiBackCompat !== false ) {
10711062
panel: data.newPanel[ 0 ],
10721063
index: data.newTab.closest( "li" ).index()
10731064
});
1074-
} else if ( type === "activate" && data.newTab.length ) {
1075-
ret = this._super( "show", event, {
1076-
tab: data.newTab.find( ".ui-tabs-anchor" )[ 0 ],
1077-
panel: data.newPanel[ 0 ],
1078-
index: data.newTab.closest( "li" ).index()
1079-
});
10801065
}
10811066
return ret;
10821067
}

0 commit comments

Comments
 (0)