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

Function handleToolBarClick

src/workbench/sidebar/explore/editorTree.tsx:159–177  ·  view source on GitHub ↗
(
        e: React.MouseEvent<Element, MouseEvent>,
        item: IActionBarItemProps,
        group: IEditorGroup
    )

Source from the content-addressed store, hash-verified

157 };
158
159 const handleToolBarClick = (
160 e: React.MouseEvent<Element, MouseEvent>,
161 item: IActionBarItemProps,
162 group: IEditorGroup
163 ) => {
164 e.stopPropagation();
165 switch (item.id) {
166 case constants.EXPLORER_TOGGLE_CLOSE_GROUP_EDITORS:
167 onCloseGroup?.(group.id!);
168 break;
169 case constants.EXPLORER_TOGGLE_SAVE_GROUP:
170 onSaveGroup?.(group.id!);
171 break;
172 default:
173 // default behavior
174 onToolbarClick?.(item, group.id!);
175 break;
176 }
177 };
178
179 return (
180 <Scrollbar ref={scrollable} isShowShadow>

Callers 1

EditorTreeFunction · 0.85

Calls 1

onToolbarClickFunction · 0.85

Tested by

no test coverage detected