diff options
| author | Jules Laplace <julescarbon@gmail.com> | 2020-06-03 23:20:11 +0200 |
|---|---|---|
| committer | Jules Laplace <julescarbon@gmail.com> | 2020-06-03 23:20:11 +0200 |
| commit | c2085dd105b8dd4db41dbf6fb8d6e2d03f61edd2 (patch) | |
| tree | 6022fb67cf633d891baffa96364ab58af92b45f2 /frontend/views/page/components/page.editor.js | |
| parent | 1070d4b87f664e85ff7defa530727c97337d16db (diff) | |
dragging images and text
Diffstat (limited to 'frontend/views/page/components/page.editor.js')
| -rw-r--r-- | frontend/views/page/components/page.editor.js | 6 |
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) } |
