UI actions; Context menu
This commit is contained in:
25
src/js/services/ui/reducer.js
Executable file
25
src/js/services/ui/reducer.js
Executable file
@ -0,0 +1,25 @@
|
||||
|
||||
export default function reducer(ui = {}, action){
|
||||
switch (action.type) {
|
||||
|
||||
case 'UI_SHOW_CONTEXT_MENU':
|
||||
return Object.assign({}, ui, {
|
||||
context_menu: {
|
||||
show: true,
|
||||
position_x: action.position_x,
|
||||
position_y: action.position_y,
|
||||
context: action.context,
|
||||
data: action.data
|
||||
}
|
||||
});
|
||||
|
||||
case 'UI_HIDE_CONTEXT_MENU':
|
||||
return Object.assign({}, ui, { context_menu: { show: false } });
|
||||
|
||||
default:
|
||||
return ui
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user