summaryrefslogtreecommitdiff
path: root/frontend/views/page/components
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/views/page/components
parent1070d4b87f664e85ff7defa530727c97337d16db (diff)
dragging images and text
Diffstat (limited to 'frontend/views/page/components')
-rw-r--r--frontend/views/page/components/page.editor.js6
1 files changed, 4 insertions, 2 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)
}