summaryrefslogtreecommitdiff
path: root/frontend/app/views/page/page.reducer.js
diff options
context:
space:
mode:
authorJules Laplace <julescarbon@gmail.com>2021-04-01 17:30:37 +0200
committerJules Laplace <julescarbon@gmail.com>2021-04-01 17:30:37 +0200
commit7e344419330855dbbf10896c39e91b4e6861dd57 (patch)
treea8baae6cb875a3e8dad47bc4d8392738445f00fd /frontend/app/views/page/page.reducer.js
parent5cafa9d43b769e6f60740f59293ddf3588e7b8ad (diff)
displaying custom cursors on the frontend
Diffstat (limited to 'frontend/app/views/page/page.reducer.js')
-rw-r--r--frontend/app/views/page/page.reducer.js31
1 files changed, 31 insertions, 0 deletions
diff --git a/frontend/app/views/page/page.reducer.js b/frontend/app/views/page/page.reducer.js
index a1f281a..9eb6ff7 100644
--- a/frontend/app/views/page/page.reducer.js
+++ b/frontend/app/views/page/page.reducer.js
@@ -11,7 +11,9 @@ const initialState = crudState('page', {
tileList: false,
showingPopups: true,
sidebarOnRight: true,
+ cursorList: false,
popups: {},
+ pickedCursor: null,
},
options: {
}
@@ -98,6 +100,7 @@ export default function pageReducer(state = initialState, action) {
addingTile: true,
editingTile: false,
tileList: false,
+ cursorList: false,
}
}
@@ -107,6 +110,7 @@ export default function pageReducer(state = initialState, action) {
editor: {
...state.editor,
addingTile: false,
+ cursorList: false,
}
}
@@ -118,6 +122,7 @@ export default function pageReducer(state = initialState, action) {
addingTile: !state.editor.addingTile,
editingTile: false,
tileList: false,
+ cursorList: false,
}
}
@@ -131,6 +136,7 @@ export default function pageReducer(state = initialState, action) {
editingTile: true,
currentEditTileId: action.tile_id,
tileList: false,
+ cursorList: false,
}
}
@@ -140,6 +146,7 @@ export default function pageReducer(state = initialState, action) {
editor: {
...state.editor,
editingTile: false,
+ cursorList: false,
}
}
@@ -152,6 +159,7 @@ export default function pageReducer(state = initialState, action) {
addingTile: false,
editingTile: false,
tileList: true,
+ cursorList: false,
}
}
@@ -161,6 +169,7 @@ export default function pageReducer(state = initialState, action) {
editor: {
...state.editor,
tileList: false,
+ cursorList: false,
}
}
@@ -172,6 +181,7 @@ export default function pageReducer(state = initialState, action) {
addingTile: false,
editingTile: false,
tileList: !state.editor.tileList,
+ cursorList: false,
}
}
@@ -183,6 +193,27 @@ export default function pageReducer(state = initialState, action) {
addingTile: false,
editingTile: false,
tileList: false,
+ cursorList: false,
+ }
+ }
+
+ case types.page.toggle_cursor_list:
+ return {
+ ...state,
+ editor: {
+ ...state.editor,
+ cursorList: (typeof action.visible !== undefined)
+ ? action.visible : !state.editor.cursorList
+ }
+ }
+
+ case types.page.pick_cursor:
+ return {
+ ...state,
+ editor: {
+ ...state.editor,
+ cursorList: false,
+ pickedCursor: action.cursor,
}
}