Search
Export
Share
Sort
Sort
Ascending
Descending
Display
Display
Default
Compact
Filter
Delete
Search
Export
Share
Sort
Sort
Ascending
Descending
Display
Display
Default
Compact
Filter
Delete
{"ScriptPreparationCode":"function getDefaultSlottedContent(element) {\r\n return [...element.childNodes].filter(child =\u003E {\r\n if (child.nodeType === Node.ELEMENT_NODE \u0026\u0026 (child).tagName.toLowerCase() === \u0027flux-tooltip\u0027) {\r\n return false;\r\n }\r\n\r\n return (\r\n (child.nodeType === Node.TEXT_NODE \u0026\u0026 child.textContent.trim() !== \u0027\u0027) ||\r\n (child.nodeType === Node.ELEMENT_NODE \u0026\u0026 !child[\u0027slot\u0027])\r\n );\r\n });\r\n}","TestCases":[{"Name":"for loop","Code":"\r\nconst overflowContent = document.querySelector(\u0027flux-list\u0027);\r\nconst listItems = getDefaultSlottedContent(overflowContent);\r\nfor (let i = 0; i \u003C listItems.length; i\u002B\u002B) {\r\n const listItem = listItems[i];\r\n const listItemClassList = listItem.classList;\r\n\r\n // menu\r\n if (listItemClassList.contains(\u0027menu\u0027)) {\r\n listItemClassList.remove(\u0027menu-closed\u0027);\r\n }\r\n\r\n // submenu\r\n if (listItemClassList.contains(\u0027submenu\u0027)) {\r\n listItemClassList.add(\u0027submenu-closed\u0027);\r\n listItem.hidden = true;\r\n }\r\n}","IsDeferred":false},{"Name":"forEach","Code":"\r\nconst overflowContent = document.querySelector(\u0027flux-list\u0027);\r\nconst menus = overflowContent.querySelectorAll(\u0027.menu\u0027);\r\nmenus.forEach(item =\u003E item.classList.remove(\u0027menu-closed\u0027));\r\n\r\nconst submenus = overflowContent.querySelectorAll(\u0027.submenu\u0027);\r\nsubmenus.forEach(item =\u003E item.classList.add(\u0027submenu-closed\u0027));","IsDeferred":false}]}