remove sketcher from actions

This commit is contained in:
casperlamboo 2017-11-14 17:47:16 +01:00
parent 3c41980fb9
commit 22ca7dc0c5

View File

@ -35,11 +35,11 @@ function getChildrenValues(childrenData = []) {
// item specific reducer // item specific reducer
function item(state, action) { function item(state, action) {
switch (action.type) { switch (action.type) {
case actions.sketcher.MENU_OPEN: case actions.MENU_OPEN:
case actions.sketcher.MENU_CLOSE: case actions.MENU_CLOSE:
return { return {
...state, ...state,
open: (action.type === actions.sketcher.MENU_OPEN) open: (action.type === actions.MENU_OPEN)
}; };
default: default:
return state; return state;
@ -75,20 +75,20 @@ export const select = (state, value) => {
}; };
export default function menusReducer(state = initialState, action) { export default function menusReducer(state = initialState, action) {
if (action.category === actions.sketcher.CAT_SELECTION) { if (action.category === actions.CAT_SELECTION) {
state = select(state, d2Tools.TRANSFORM); state = select(state, d2Tools.TRANSFORM);
} }
switch (action.type) { switch (action.type) {
case actions.sketcher.MENU_OPEN: case actions.MENU_OPEN:
case actions.sketcher.MENU_CLOSE: case actions.MENU_CLOSE:
if (action.menuValue === undefined) return state; if (action.menuValue === undefined) return state;
return { return {
...state, ...state,
[action.menuValue]: item(state[action.menuValue], action) [action.menuValue]: item(state[action.menuValue], action)
}; };
case actions.sketcher.D2_CHANGE_TOOL: case actions.D2_CHANGE_TOOL:
case actions.sketcher.D3_CHANGE_TOOL: case actions.D3_CHANGE_TOOL:
case actions.sketcher.CONTEXT_CHANGE_TOOL: case actions.CONTEXT_CHANGE_TOOL:
// recursivly select items in menu's // recursivly select items in menu's
return select(state, action.tool); return select(state, action.tool);
default: default: