diff --git a/app/views/alchemy/admin/essence_pictures/update.js.erb b/app/views/alchemy/admin/essence_pictures/update.js.erb index ff3081b723..47e1680f54 100644 --- a/app/views/alchemy/admin/essence_pictures/update.js.erb +++ b/app/views/alchemy/admin/essence_pictures/update.js.erb @@ -1,5 +1,4 @@ (function($) { - Alchemy.ImageCropper.destroy(); Alchemy.closeCurrentDialog(); Alchemy.setElementDirty('#element_<%= @content.element.id %>'); <% if @content.ingredient %> diff --git a/package/src/image_cropper.js b/package/src/image_cropper.js index 66099ccb07..6e105f3cc6 100644 --- a/package/src/image_cropper.js +++ b/package/src/image_cropper.js @@ -17,6 +17,7 @@ export default class ImageCropper { this.cropSizeField = document.getElementById(formFieldIds[1]) this.elementId = elementId this.dialog = Alchemy.currentDialog() + this.dialog.options.closed = this.destroy this.init() this.bind()