X-Git-Url: https://git.arvados.org/arvados-workbench2.git/blobdiff_plain/0a0db4ca8433ae210df5cf1475dd2b77e4aabec9..a4927ea74470ad483921813d93597b451e3d8e3e:/src/store/details-panel/details-panel-action.ts diff --git a/src/store/details-panel/details-panel-action.ts b/src/store/details-panel/details-panel-action.ts index 6aebc050..2c742a1f 100644 --- a/src/store/details-panel/details-panel-action.ts +++ b/src/store/details-panel/details-panel-action.ts @@ -14,6 +14,8 @@ import { startSubmit, stopSubmit } from 'redux-form'; import { resourcesActions } from '~/store/resources/resources-actions'; import { snackbarActions } from '~/store/snackbar/snackbar-actions'; +export const SLIDE_TIMEOUT = 500; + export const detailsPanelActions = unionize({ TOGGLE_DETAILS_PANEL: ofType<{}>(), LOAD_DETAILS_PANEL: ofType() @@ -66,4 +68,12 @@ export const createProjectProperty = (data: TagProperty) => dispatch(dialogActions.CLOSE_DIALOG({ id: PROJECT_PROPERTIES_FORM_NAME })); throw new Error('Could not add property to the project.'); } - }; \ No newline at end of file + }; +export const toggleDetailsPanel = () => (dispatch: Dispatch) => { + // because of material-ui issue resizing details panel breaks tabs. + // triggering window resize event fixes that. + setTimeout(() => { + window.dispatchEvent(new Event('resize')); + }, SLIDE_TIMEOUT); + dispatch(detailsPanelActions.TOGGLE_DETAILS_PANEL()); +};