Fixed: Destroy popup when upload has failed

This commit is contained in:
philipp lang 2020-10-25 20:58:57 +01:00
parent b113aa47fe
commit 4115e3c9ab
1 changed files with 3 additions and 5 deletions

View File

@ -18,15 +18,13 @@ export default {
values: { crop: null }
};
if ($(`#${this.popupId}`).length == 0) {
$('body').append(this.popupContent);
}
$('body').append(this.popupContent);
return new Promise((resolve, reject) => {
var $popup = $(`#${this.popupId}`);
$popup.modal({ backdrop: false });
$popup.on('shown.bs.modal', function() {
$popup.one('shown.bs.modal', function() {
var $cropContainer = $popup.find('[data-jcrop]');
var imageElement = new Image();
@ -60,7 +58,7 @@ export default {
});
$popup.off('hidden.bs.modal').one('hidden.bs.modal', () => {
$popup.modal('hide');
$popup.remove();
reject(null);
});