summaryrefslogtreecommitdiff
path: root/frontend/views/page/components/tile.edit.js
diff options
context:
space:
mode:
authorJules Laplace <julescarbon@gmail.com>2020-06-06 23:35:47 +0200
committerJules Laplace <julescarbon@gmail.com>2020-06-06 23:35:47 +0200
commitf5f22f7d77506ffe9c3723f4c958c1feabca6074 (patch)
tree6f39799842fa8b608ae593adf514db08fac23e51 /frontend/views/page/components/tile.edit.js
parentdbc42f5c3bec4d7fd04f3ce9d684089d6fcb4393 (diff)
if the item has changed, save before we close the form
Diffstat (limited to 'frontend/views/page/components/tile.edit.js')
-rw-r--r--frontend/views/page/components/tile.edit.js8
1 files changed, 6 insertions, 2 deletions
diff --git a/frontend/views/page/components/tile.edit.js b/frontend/views/page/components/tile.edit.js
index 2f6dad7..bfcc34f 100644
--- a/frontend/views/page/components/tile.edit.js
+++ b/frontend/views/page/components/tile.edit.js
@@ -41,11 +41,14 @@ class TileEdit extends Component {
if (response.status === 'ok') {
this.props.pageActions.updatePageTile(response.res)
}
- this.props.pageActions.hideEditTileForm()
- this.props.tileActions.clearTemporaryTile()
})
}
+ handleClose() {
+ this.props.pageActions.hideEditTileForm()
+ this.props.tileActions.clearTemporaryTile()
+ }
+
render() {
const { tile } = this.state
if (!tile) {
@@ -61,6 +64,7 @@ class TileEdit extends Component {
graph={this.props.graph.show.res}
page={this.props.page.show.res}
onSubmit={this.handleSubmit.bind(this)}
+ onClose={this.handleClose.bind(this)}
/>
)
}