← All changes
|
modules/atomic-widgets/elements/atomic-tabs/handlers/utils.js
+6
-0
4.0.9
→
4.3.2
View file →
| @@ -27,8 +27,14 @@ | ||
| 27 | 27 | |
| 28 | 28 | return children.indexOf( el ); |
| 29 | 29 | }; |
| 30 | 30 | |
| 31 | +export const getDirectTabCount = ( tabsRootElement ) => { | |
| 32 | + return tabsRootElement.querySelectorAll( | |
| 33 | + `:scope > [data-element_type="${ TABS_MENU_ELEMENT_TYPE }"] > [data-element_type="${ TAB_ELEMENT_TYPE }"]`, | |
| 34 | + ).length; | |
| 35 | +}; | |
| 36 | + | |
| 31 | 37 | export const getNextTab = ( key, tab ) => { |
| 32 | 38 | const tabs = getChildren( tab, TAB_ELEMENT_TYPE ); |
| 33 | 39 | const tabsLength = tabs.length; |
| 34 | 40 | |