MCPcopy Create free account
hub / github.com/DTStack/molecule / visibleMenuItem

Function visibleMenuItem

src/components/menu/menu.tsx:28–39  ·  view source on GitHub ↗
(item?: HTMLElement)

Source from the content-addressed store, hash-verified

26export type IMenuProps = ISubMenuProps;
27
28const visibleMenuItem = (item?: HTMLElement) => {
29 if (!item) return;
30 if (item?.dataset.submenu) {
31 const subMenu: HTMLElement = Array.prototype.find.call(
32 item.children,
33 (dom: HTMLElement) => dom.nodeName === 'UL'
34 );
35 subMenu.style.opacity = '1';
36 subMenu.style.pointerEvents = 'auto';
37 item.classList.add(activeClassName);
38 }
39};
40
41const setPositionForSubMenu = (
42 item?: HTMLElement,

Callers 1

MenuCompFunction · 0.85

Calls 1

addMethod · 0.65

Tested by

no test coverage detected