From c2085dd105b8dd4db41dbf6fb8d6e2d03f61edd2 Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Wed, 3 Jun 2020 23:20:11 +0200 Subject: dragging images and text --- frontend/views/page/components/page.editor.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'frontend/views/page/components') 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) } -- cgit v1.2.3-70-g09d2