summaryrefslogtreecommitdiff
path: root/frontend
diff options
context:
space:
mode:
authorJules Laplace <julescarbon@gmail.com>2020-06-03 23:20:11 +0200
committerJules Laplace <julescarbon@gmail.com>2020-06-03 23:20:11 +0200
commitc2085dd105b8dd4db41dbf6fb8d6e2d03f61edd2 (patch)
tree6022fb67cf633d891baffa96364ab58af92b45f2 /frontend
parent1070d4b87f664e85ff7defa530727c97337d16db (diff)
dragging images and text
Diffstat (limited to 'frontend')
-rw-r--r--frontend/views/page/components/page.editor.js6
-rw-r--r--frontend/views/page/page.actions.js2
2 files changed, 5 insertions, 3 deletions
diff --git a/frontend/views/page/components/page.editor.js b/frontend/views/page/components/page.editor.js
index a806dc0..38f74ea 100644
--- a/frontend/views/page/components/page.editor.js
+++ b/frontend/views/page/components/page.editor.js
@@ -120,6 +120,7 @@ class PageEditor extends Component {
handleMouseUp(e) {
// const { actions } = this.props
+ const { temporaryTile } = this.props
const { dragging, draggingBox, bounds, box, tile } = this.state
if (!dragging && !draggingBox) return
e.preventDefault()
@@ -145,9 +146,10 @@ class PageEditor extends Component {
y: tile.settings.y + dy,
}
}
- if (tile.id === 'new') {
+ if (temporaryTile && tile.id === temporaryTile.id) {
this.props.tileActions.updateTemporaryTile(updatedTile)
- } else {
+ }
+ if (tile.id !== 'new') {
this.props.pageActions.updatePageTile(updatedTile)
actions.tile.update(updatedTile)
}
diff --git a/frontend/views/page/page.actions.js b/frontend/views/page/page.actions.js
index 8261515..b58abb5 100644
--- a/frontend/views/page/page.actions.js
+++ b/frontend/views/page/page.actions.js
@@ -15,7 +15,7 @@ export const toggleAddTileForm = () => dispatch => {
}
export const updatePageTile = tile => dispatch => {
- dispatch({ type: types.page.update_graph_tile, tile })
+ dispatch({ type: types.page.update_page_tile, tile })
}
export const showGraphAndPageIfUnloaded = ({ graph_name, page_name }) => dispatch => (