Skip to content
Snippets Groups Projects
Commit 09d80e43 authored by Chris Beer's avatar Chris Beer
Browse files

Add an action and reducer for changing the thumbnail nav state

parent 8edc6a56
No related branches found
No related tags found
No related merge requests found
......@@ -12,6 +12,7 @@ const ActionTypes = {
RECEIVE_MANIFEST: 'RECEIVE_MANIFEST',
RECEIVE_MANIFEST_FAILURE: 'RECEIVE_MANIFEST_FAILURE',
SET_CONFIG: 'SET_CONFIG',
SET_WINDOW_THUMBNAIL_POSITION: 'SET_WINDOW_THUMBNAIL_POSITION',
TOGGLE_WINDOW_SIDE_BAR: 'TOGGLE_WINDOW_SIDE_BAR',
UPDATE_CONFIG: 'UPDATE_CONFIG',
REMOVE_MANIFEST: 'REMOVE_MANIFEST',
......
......@@ -50,3 +50,13 @@ export function removeWindow(windowId) {
export function toggleWindowSideBar(windowId) {
return { type: ActionTypes.TOGGLE_WINDOW_SIDE_BAR, windowId };
}
/**
* toggleWindowSideBar - action creator
*
* @param {String} windowId
* @memberof ActionCreators
*/
export function setWindowThumbnailPosition(windowId, position) {
return { type: ActionTypes.SET_WINDOW_THUMBNAIL_POSITION, windowId, position };
}
......@@ -22,6 +22,14 @@ const windowsReducer = (state = {}, action) => {
sideBarOpen: !state[action.windowId].sideBarOpen,
},
};
case ActionTypes.SET_WINDOW_THUMBNAIL_POSITION:
return {
...state,
[action.windowId]: {
...state[action.windowId],
thumbnailNavigationPosition: action.position,
},
};
case ActionTypes.NEXT_CANVAS:
return setCanvasIndex(state, action.windowId, currentIndex => currentIndex + 1);
case ActionTypes.PREVIOUS_CANVAS:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment