@@ -59,16 +59,13 @@ export const tabEnter: Command = (state) => {
5959
6060const makeTabsInactive = ( tabNodes : NodeWithPos [ ] , tabPanels : NodeWithPos [ ] , tr : Transaction ) => {
6161 // Find all active tabs and make them inactive
62- const activeTabs = tabNodes . filter (
63- ( v ) => v . node . attrs [ TabAttrs . dataDiplodocIsActive ] === 'true' ,
64- ) ;
62+ const activeTabs = tabNodes . filter ( ( v ) => v . node . attrs [ TabAttrs . class ] === tabActiveClassname ) ;
6563
6664 if ( activeTabs . length ) {
6765 activeTabs . forEach ( ( tab ) => {
6866 tr . setNodeMarkup ( tab . pos , null , {
6967 ...tab . node . attrs ,
7068 class : tabInactiveClassname ,
71- [ TabAttrs . dataDiplodocIsActive ] : 'false' ,
7269 } ) ;
7370 } ) ;
7471 }
@@ -101,7 +98,7 @@ export const createTab: (afterTab: NodeWithPos, tabsParentNode: NodeWithPos) =>
10198 const afterPanelNode = tabPanels . filter (
10299 ( tabPanelNode ) =>
103100 tabPanelNode . node . attrs [ TabPanelAttrs . ariaLabelledby ] ===
104- afterTab . node . attrs [ TabAttrs . dataDiplodocid ] ,
101+ afterTab . node . attrs [ TabAttrs . id ] ,
105102 ) [ 0 ] ;
106103
107104 const tabId = generateID ( ) ;
@@ -117,9 +114,6 @@ export const createTab: (afterTab: NodeWithPos, tabsParentNode: NodeWithPos) =>
117114 ) ;
118115 const newTab = tabType ( state . schema ) . create ( {
119116 [ TabAttrs . id ] : tabId ,
120- [ TabAttrs . dataDiplodocid ] : tabId ,
121- [ TabAttrs . dataDiplodocKey ] : tabId ,
122- [ TabAttrs . dataDiplodocIsActive ] : 'true' ,
123117 [ TabAttrs . class ] : tabActiveClassname ,
124118 [ TabAttrs . role ] : 'tab' ,
125119 [ TabAttrs . ariaControls ] : panelId ,
@@ -171,7 +165,7 @@ export const removeTab: (tabToRemove: NodeWithPos, tabsParentNode: NodeWithPos)
171165 const panelToRemove = tabPanels . filter (
172166 ( tabPanelNode ) =>
173167 tabPanelNode . node . attrs [ TabPanelAttrs . ariaLabelledby ] ===
174- tabToRemove . node . attrs [ TabAttrs . dataDiplodocid ] ,
168+ tabToRemove . node . attrs [ TabAttrs . id ] ,
175169 ) [ 0 ] ;
176170
177171 if ( panelToRemove && dispatch ) {
@@ -206,7 +200,6 @@ export const removeTab: (tabToRemove: NodeWithPos, tabsParentNode: NodeWithPos)
206200 . setNodeMarkup ( tr . mapping . map ( newTabNode . pos ) , null , {
207201 ...newTabNode . node . attrs ,
208202 class : tabActiveClassname ,
209- [ TabAttrs . dataDiplodocIsActive ] : 'true' ,
210203 } )
211204 // Set new active panel
212205 . setNodeMarkup ( tr . mapping . map ( newTabPanelNode . pos ) , null , {
0 commit comments