X-Git-Url: https://git.arvados.org/arvados-workbench2.git/blobdiff_plain/d1231b6ce7e8d40498b15011b88117812acdf632..1eb2cc60cbf40d86db2304e11a678c3aa51af321:/src/store/details-panel/details-panel-action.ts?ds=inline diff --git a/src/store/details-panel/details-panel-action.ts b/src/store/details-panel/details-panel-action.ts index ed717165..0f132865 100644 --- a/src/store/details-panel/details-panel-action.ts +++ b/src/store/details-panel/details-panel-action.ts @@ -5,6 +5,8 @@ import { unionize, ofType, UnionOf } from '~/common/unionize'; import { Dispatch } from 'redux'; +export const SLIDE_TIMEOUT = 500; + export const detailsPanelActions = unionize({ TOGGLE_DETAILS_PANEL: ofType<{}>(), LOAD_DETAILS_PANEL: ofType() @@ -17,9 +19,8 @@ export const loadDetailsPanel = (uuid: string) => detailsPanelActions.LOAD_DETAI export const toggleDetailsPanel = () => (dispatch: Dispatch) => { // because of material-ui issue resizing details panel breaks tabs. // triggering window resize event fixes that. - const detailsPanelAnimationDuration = 500; setTimeout(() => { window.dispatchEvent(new Event('resize')); - }, detailsPanelAnimationDuration); + }, SLIDE_TIMEOUT); dispatch(detailsPanelActions.TOGGLE_DETAILS_PANEL()); };