@@ -32,7 +32,7 @@ export class SelectionContainerModel extends BoxModel {
32
32
...super . defaults ( ) ,
33
33
_model_name : 'SelectionContainerModel' ,
34
34
selected_index : 0 ,
35
- _titles : { }
35
+ titles : [ ]
36
36
} ;
37
37
}
38
38
}
@@ -115,7 +115,7 @@ export class AccordionView extends DOMWidgetView {
115
115
this . listenTo ( this . model , 'change:selected_index' , ( ) =>
116
116
this . update_selected_index ( )
117
117
) ;
118
- this . listenTo ( this . model , 'change:_titles ' , ( ) => this . update_titles ( ) ) ;
118
+ this . listenTo ( this . model , 'change:titles ' , ( ) => this . update_titles ( ) ) ;
119
119
}
120
120
121
121
/**
@@ -158,7 +158,7 @@ export class AccordionView extends DOMWidgetView {
158
158
*/
159
159
update_titles ( ) : void {
160
160
const collapsed = this . pWidget . collapseWidgets ;
161
- const titles = this . model . get ( '_titles ' ) ;
161
+ const titles = this . model . get ( 'titles ' ) ;
162
162
for ( let i = 0 ; i < collapsed . length ; i ++ ) {
163
163
if ( titles [ i ] !== void 0 ) {
164
164
collapsed [ i ] . widget . title . label = titles [ i ] ;
@@ -188,7 +188,7 @@ export class AccordionView extends DOMWidgetView {
188
188
// Placeholder widget to keep our position in the tab panel while we create the view.
189
189
const accordion = this . pWidget ;
190
190
const placeholder = new Widget ( ) ;
191
- placeholder . title . label = this . model . get ( '_titles ' ) [ index ] || '' ;
191
+ placeholder . title . label = this . model . get ( 'titles ' ) [ index ] || '' ;
192
192
accordion . addWidget ( placeholder ) ;
193
193
return this . create_child_view ( model )
194
194
. then ( ( view : DOMWidgetView ) => {
@@ -293,7 +293,7 @@ export class TabView extends DOMWidgetView {
293
293
this
294
294
) ;
295
295
this . listenTo ( this . model , 'change:children' , ( ) => this . updateTabs ( ) ) ;
296
- this . listenTo ( this . model , 'change:_titles ' , ( ) => this . updateTitles ( ) ) ;
296
+ this . listenTo ( this . model , 'change:titles ' , ( ) => this . updateTitles ( ) ) ;
297
297
}
298
298
299
299
/**
@@ -339,7 +339,7 @@ export class TabView extends DOMWidgetView {
339
339
*/
340
340
addChildView ( model : WidgetModel , index : number ) : Promise < DOMWidgetView > {
341
341
// Placeholder widget to keep our position in the tab panel while we create the view.
342
- const label = this . model . get ( '_titles ' ) [ index ] || '' ;
342
+ const label = this . model . get ( 'titles ' ) [ index ] || '' ;
343
343
const tabs = this . pWidget ;
344
344
const placeholder = new Widget ( ) ;
345
345
placeholder . title . label = label ;
@@ -379,7 +379,7 @@ export class TabView extends DOMWidgetView {
379
379
* Updates the tab page titles.
380
380
*/
381
381
updateTitles ( ) : void {
382
- const titles = this . model . get ( '_titles ' ) || { } ;
382
+ const titles = this . model . get ( 'titles ' ) || [ ] ;
383
383
each ( this . pWidget . widgets , ( widget , i ) => {
384
384
widget . title . label = titles [ i ] || '' ;
385
385
} ) ;
0 commit comments