From 16198af30d6227e481a0da0050185230f4676000 Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Sun, 16 Aug 2020 17:02:07 +0200 Subject: heading text on section V --- .../frontend/app/views/media/components/media.formGallery.js | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'animism-align/frontend/app/views/media/components/media.formGallery.js') diff --git a/animism-align/frontend/app/views/media/components/media.formGallery.js b/animism-align/frontend/app/views/media/components/media.formGallery.js index 25b715c..b2e0381 100644 --- a/animism-align/frontend/app/views/media/components/media.formGallery.js +++ b/animism-align/frontend/app/views/media/components/media.formGallery.js @@ -26,6 +26,7 @@ export default class MediaGalleryForm extends Component { this.uploadSize = this.uploadSize.bind(this) this.handleSaveItem = this.handleSaveItem.bind(this) this.handleUploadGalleryThumbnail = this.handleUploadGalleryThumbnail.bind(this) + this.handleDestroyGalleryThumbnail = this.handleDestroyGalleryThumbnail.bind(this) } handleChange(e) { @@ -53,7 +54,7 @@ export default class MediaGalleryForm extends Component { handleUploadGalleryThumbnail(file) { this.setState({ loading: true }) if (this.props.data.thumbnail) { - actions.upload.destroy({ id: this.props.data.thumbnail.id }) + this.handleDestroyGalleryThumbnail() } this.uploadThumbnail(file, 'thumbnail', THUMBNAIL_SIZE, THUMBNAIL_QUALITY) .then(data => { @@ -65,6 +66,14 @@ export default class MediaGalleryForm extends Component { }) } + handleDestroyGalleryThumbnail(e) { + if (e) { + e.preventDefault() + e.stopPropagation() + } + actions.upload.destroy({ id: this.props.data.thumbnail.id }) + } + uploadFullsize(files) { const { data } = this.props // first, upload all the fullsize files @@ -283,6 +292,7 @@ export default class MediaGalleryForm extends Component {
Thumbnail +
} -- cgit v1.2.3-70-g09d2