Merge branch 'feat/v2-main' of github.com:OHIF/Viewers into feat/ohif-151
This commit is contained in:
commit
5d89460326
38 files changed
+919
-169
No files matched your search
@@ -63,13 +63,20 @@ function ViewerLayout({
|
||||
setActiveTool(isNested ? tool : defaultTool);
|
||||
};
|
||||
|
||||
const onPrimaryClickHandler = (evt, btn) => {
|
||||
if (btn.props && btn.props.commands && evt.value && btn.props.commands[evt.value]) {
|
||||
const { commandName, commandOptions } = btn.props.commands[evt.value];
|
||||
commandsManager.runCommand(commandName, commandOptions);
|
||||
}
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
const { unsubscribe } = ToolBarService.subscribe(
|
||||
ToolBarService.EVENTS.TOOL_BAR_MODIFIED,
|
||||
() => {
|
||||
console.warn('~~~ TOOL BAR MODIFIED EVENT CAUGHT');
|
||||
const updatedToolbars = {
|
||||
primary: ToolBarService.getButtonSection('primary', { setActiveTool: setActiveToolHandler }),
|
||||
primary: ToolBarService.getButtonSection('primary', { onClick: onPrimaryClickHandler, setActiveTool: setActiveToolHandler }),
|
||||
secondary: ToolBarService.getButtonSection('secondary', { setActiveTool: setActiveToolHandler }),
|
||||
};
|
||||
setToolbars(updatedToolbars);
|
||||
|
||||
Reference in new issue
Block a user