Skip to content
Snippets Groups Projects
Commit 45ee17af authored by Camille Villa's avatar Camille Villa
Browse files

Display info panel when toggling open sidebar panel


Co-Authored-By: default avatarChris Beer <chris@cbeer.info>
parent 7b4e6119
Branches
Tags
No related merge requests found
......@@ -19,6 +19,7 @@ export function focusWindow(windowId) {
* @memberof ActionCreators
*/
export function addWindow(options) {
const cwDefault = `cw-${uuid()}`;
const defaultOptions = {
id: `window-${uuid()}`,
canvasIndex: 0,
......@@ -30,12 +31,13 @@ export function addWindow(options) {
height: 400,
x: 2700,
y: 2700,
companionWindowIds: [],
companionWindowIds: [cwDefault],
sideBarPanel: 'info',
rotation: null,
view: 'single',
maximized: false,
};
return { type: ActionTypes.ADD_WINDOW, window: { ...defaultOptions, ...options } };
return { type: ActionTypes.ADD_WINDOW, window: { ...defaultOptions, ...options }, companionWindow: { id: cwDefault, position: 'left', content: 'info' } };
}
/**
......
......@@ -9,6 +9,9 @@ export function companionWindowsReducer(state = {}, action) {
case ActionTypes.ADD_COMPANION_WINDOW:
return setIn(state, [action.id], action.payload);
case ActionTypes.ADD_WINDOW:
return setIn(state, [action.companionWindow.id], action.companionWindow);
case ActionTypes.UPDATE_COMPANION_WINDOW:
return updateIn(state, [action.id], orig => merge(orig, action.payload));
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment