action on ViewportPanes for setting the active viewport

This commit is contained in:
dannyrb committed 2020-05-24 22:34:01 -04:00
1 parent 30caec0043
commit 9b75d95e48
3 files changed
+30 -2

No files matched your search

@@ -12,6 +12,9 @@ function ViewerViewportGrid(props) {
{ numCols, numRows, activeViewportIndex, viewports },
dispatch,
] = useViewportGrid();
const setActiveViewportIndex = index => {
dispatch({ type: 'SET_ACTIVE_VIEWPORT_INDEX', payload: index });
}
// TODO -> Need some way of selecting which displaySets hit the viewports.
const { DisplaySetService } = servicesManager.services;
@@ -97,6 +100,9 @@ function ViewerViewportGrid(props) {
className="m-1"
acceptDropsFor="displayset"
onDrop={onDropHandler}
onScroll={() => { setActiveViewportIndex(viewportIndex); }}
onClick={() => { setActiveViewportIndex(viewportIndex); }}
onWheel={() => { setActiveViewportIndex(viewportIndex); }}
isActive={activeViewportIndex === viewportIndex}
>
<EmptyViewport />