@@ -126,7 +126,7 @@ $.widget( "ui.tabs", {
126
126
127
127
// inline tab
128
128
if ( fragmentId . test ( href ) ) {
129
- self . panels = self . panels . add ( self . _sanitizeSelector ( href ) ) ;
129
+ self . panels = self . panels . add ( self . element . find ( self . _sanitizeSelector ( href ) ) ) ;
130
130
// remote tab
131
131
// prevent loading the page itself if href is just "#"
132
132
} else if ( href && href !== "#" ) {
@@ -139,7 +139,7 @@ $.widget( "ui.tabs", {
139
139
140
140
var id = self . _tabId ( a ) ;
141
141
a . href = "#" + id ;
142
- var $panel = $ ( "#" + id ) ;
142
+ var $panel = self . element . find ( "#" + id ) ;
143
143
if ( ! $panel . length ) {
144
144
$panel = $ ( o . panelTemplate )
145
145
. attr ( "id" , id )
@@ -210,13 +210,13 @@ $.widget( "ui.tabs", {
210
210
this . lis . removeClass ( "ui-tabs-selected ui-state-active" ) ;
211
211
// check for length avoids error when initializing empty list
212
212
if ( o . selected >= 0 && this . anchors . length ) {
213
- $ ( self . _sanitizeSelector ( self . anchors [ o . selected ] . hash ) ) . removeClass ( "ui-tabs-hide" ) ;
213
+ self . element . find ( self . _sanitizeSelector ( self . anchors [ o . selected ] . hash ) ) . removeClass ( "ui-tabs-hide" ) ;
214
214
this . lis . eq ( o . selected ) . addClass ( "ui-tabs-selected ui-state-active" ) ;
215
215
216
216
// seems to be expected behavior that the show callback is fired
217
217
self . element . queue ( "tabs" , function ( ) {
218
218
self . _trigger ( "show" , null ,
219
- self . _ui ( self . anchors [ o . selected ] , $ ( self . _sanitizeSelector ( self . anchors [ o . selected ] . hash ) ) ) ) ;
219
+ self . _ui ( self . anchors [ o . selected ] , self . element . find ( self . _sanitizeSelector ( self . anchors [ o . selected ] . hash ) ) ) ) ;
220
220
} ) ;
221
221
222
222
this . load ( o . selected ) ;
@@ -337,7 +337,7 @@ $.widget( "ui.tabs", {
337
337
var el = this ,
338
338
$li = $ ( el ) . closest ( "li" ) ,
339
339
$hide = self . panels . filter ( ":not(.ui-tabs-hide)" ) ,
340
- $show = $ ( self . _sanitizeSelector ( el . hash ) ) ;
340
+ $show = self . element . find ( self . _sanitizeSelector ( el . hash ) ) ;
341
341
342
342
// If tab is already selected and not collapsible or tab disabled or
343
343
// or is already loading or click callback returns false stop here.
@@ -496,7 +496,7 @@ $.widget( "ui.tabs", {
496
496
$li . addClass ( "ui-state-default ui-corner-top" ) . data ( "destroy.tabs" , true ) ;
497
497
498
498
// try to find an existing element before creating a new one
499
- var $panel = $ ( "#" + id ) ;
499
+ var $panel = self . element . find ( "#" + id ) ;
500
500
if ( ! $panel . length ) {
501
501
$panel = $ ( o . panelTemplate )
502
502
. attr ( "id" , id )
@@ -630,7 +630,7 @@ $.widget( "ui.tabs", {
630
630
this . xhr = $ . ajax ( $ . extend ( { } , o . ajaxOptions , {
631
631
url : url ,
632
632
success : function ( r , s ) {
633
- $ ( self . _sanitizeSelector ( a . hash ) ) . html ( r ) ;
633
+ self . element . find ( self . _sanitizeSelector ( a . hash ) ) . html ( r ) ;
634
634
635
635
// take care of tab labels
636
636
self . _cleanup ( ) ;
0 commit comments