@@ -163,28 +163,16 @@ const _apiProps = {
163
163
} ,
164
164
} ;
165
165
Helper . setNoneEnumProps ( _apiProps , {
166
- // getInitialState: function () {
167
- // if (!this._initialState) {
168
- // const { selectedTabID, tabs, defaultPanelComponent } = this.optionsManager.options, openTabIDs = [];
169
- // tabs.map(tab => {
170
- // const newTab = this._addTab(tab, { defaultPanelComponent });
171
- // openTabIDs.push(newTab.id);
172
- // });
173
- // this._initialState = {
174
- // selectedTabID: selectedTabID + '', //make sure it is type of string
175
- // openTabIDs
176
- // };
177
- // }
178
- // return this._initialState;
179
- // },
180
- onChange : function ( { newState, oldState, closedTabsId, openedTabsId, isSwitched} ) {
181
- if ( isSwitched || openedTabsId . length || closedTabsId . length ) {
166
+ onChange : function ( { newState, oldState, closedTabIDs, openedTabIDs, isSwitched} ) {
167
+ if ( isSwitched || openedTabIDs . length || closedTabIDs . length ) {
182
168
this . trigger ( 'onChange' , this . userProxy , {
183
169
currentData : { ...newState } ,
184
170
perviousData : { ...oldState } ,
171
+ closedTabIDs,
172
+ openedTabIDs,
185
173
} ) ;
186
- openedTabsId . length && this . trigger ( 'onOpen' , this . userProxy , openedTabsId ) ;
187
- closedTabsId . length && this . trigger ( 'onClose' , this . userProxy , closedTabsId ) ;
174
+ openedTabIDs . length && this . trigger ( 'onOpen' , this . userProxy , openedTabIDs ) ;
175
+ closedTabIDs . length && this . trigger ( 'onClose' , this . userProxy , closedTabIDs ) ;
188
176
isSwitched &&
189
177
this . trigger ( 'onSelect' , this . userProxy , {
190
178
currentSelectedTabId : newState . selectedTabID ,
0 commit comments