export const detailsPanelActions = unionize({
TOGGLE_DETAILS_PANEL: ofType<{}>(),
OPEN_DETAILS_PANEL: ofType<number>(),
- LOAD_DETAILS_PANEL: ofType<string>()
+ LOAD_DETAILS_PANEL: ofType<string>(),
+ START_TRANSITION: ofType<{}>(),
+ END_TRANSITION: ofType<{}>(),
});
export type DetailsPanelAction = UnionOf<typeof detailsPanelActions>;
export const openDetailsPanel = (uuid?: string, tabNr: number = 0) =>
(dispatch: Dispatch) => {
+ startDetailsPanelTransition(dispatch)
dispatch(detailsPanelActions.OPEN_DETAILS_PANEL(tabNr));
if (uuid !== undefined) {
dispatch<any>(loadDetailsPanel(uuid));
setTimeout(() => {
window.dispatchEvent(new Event('resize'));
}, SLIDE_TIMEOUT);
+ startDetailsPanelTransition(dispatch)
dispatch(detailsPanelActions.TOGGLE_DETAILS_PANEL());
if (getState().detailsPanel.isOpened) {
dispatch<any>(loadDetailsPanel(getState().detailsPanel.resourceUuid));
}
};
+
+const startDetailsPanelTransition = (dispatch) => {
+ dispatch(detailsPanelActions.START_TRANSITION())
+ setTimeout(() => {
+ dispatch(detailsPanelActions.END_TRANSITION())
+ }, SLIDE_TIMEOUT);
+}
\ No newline at end of file