diff --git a/src/config/settings.js b/src/config/settings.js index 13f64480cde1d680c9962d6081b846641fc380bf..d67a98b56361304c51a6ba682a26c0a0144997ef 100644 --- a/src/config/settings.js +++ b/src/config/settings.js @@ -1,3 +1,5 @@ +import uuid from 'uuid/v4'; + export default { canvasNavigation: { // Set the hight and width of canvas thumbnails in the CanvasNavigation companion window height: 50, @@ -258,6 +260,8 @@ export default { width: 100, // width of one canvas (doubled for book view) in ThumbnailNavigation area when position is "far-right" }, workspace: { + draggingEnabled: true, + id: uuid(), exposeModeOn: false, // unused? height: 5000, // height of the elastic mode's virtual canvas showZoomControls: false, // Configure if zoom controls should be displayed by default diff --git a/src/state/reducers/workspace.js b/src/state/reducers/workspace.js index ffcdf1a5db374aeabdd29ce108cebaf63be84bfd..6f01403c908277bd61490e078333ba4ee23c7c11 100644 --- a/src/state/reducers/workspace.js +++ b/src/state/reducers/workspace.js @@ -1,4 +1,4 @@ -import uuid from 'uuid/v4'; +import settings from '../../config/settings'; import ActionTypes from '../actions/action-types'; /** Check if the viewport dimensions are fully specified */ @@ -21,10 +21,7 @@ function contains(container, containee) { * workspaceReducer */ export const workspaceReducer = ( - state = { // we'll need to abstract this more, methinks. - draggingEnabled: true, - id: uuid(), - }, + state = settings.workspace, action, ) => { let newWorkspaceDimensions; @@ -91,6 +88,8 @@ export const workspaceReducer = ( case ActionTypes.TOGGLE_WORKSPACE_EXPOSE_MODE: return { ...state, exposeModeOn: !state.exposeModeOn }; case ActionTypes.SET_CONFIG: + case ActionTypes.IMPORT_CONFIG: + case ActionTypes.UPDATE_CONFIG: return { ...state, ...action.config.workspace }; case ActionTypes.IMPORT_MIRADOR_STATE: return action.state.workspace || {};