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
No related branches found
No related tags found
No related merge requests found
...@@ -19,6 +19,7 @@ export function focusWindow(windowId) { ...@@ -19,6 +19,7 @@ export function focusWindow(windowId) {
* @memberof ActionCreators * @memberof ActionCreators
*/ */
export function addWindow(options) { export function addWindow(options) {
const cwDefault = `cw-${uuid()}`;
const defaultOptions = { const defaultOptions = {
id: `window-${uuid()}`, id: `window-${uuid()}`,
canvasIndex: 0, canvasIndex: 0,
...@@ -30,12 +31,13 @@ export function addWindow(options) { ...@@ -30,12 +31,13 @@ export function addWindow(options) {
height: 400, height: 400,
x: 2700, x: 2700,
y: 2700, y: 2700,
companionWindowIds: [], companionWindowIds: [cwDefault],
sideBarPanel: 'info',
rotation: null, rotation: null,
view: 'single', view: 'single',
maximized: false, 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) { ...@@ -9,6 +9,9 @@ export function companionWindowsReducer(state = {}, action) {
case ActionTypes.ADD_COMPANION_WINDOW: case ActionTypes.ADD_COMPANION_WINDOW:
return setIn(state, [action.id], action.payload); return setIn(state, [action.id], action.payload);
case ActionTypes.ADD_WINDOW:
return setIn(state, [action.companionWindow.id], action.companionWindow);
case ActionTypes.UPDATE_COMPANION_WINDOW: case ActionTypes.UPDATE_COMPANION_WINDOW:
return updateIn(state, [action.id], orig => merge(orig, action.payload)); 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 to comment