Fixed: Destroy popup when upload has failed
This commit is contained in:
parent
b113aa47fe
commit
4115e3c9ab
|
@ -18,15 +18,13 @@ export default {
|
||||||
values: { crop: null }
|
values: { crop: null }
|
||||||
};
|
};
|
||||||
|
|
||||||
if ($(`#${this.popupId}`).length == 0) {
|
$('body').append(this.popupContent);
|
||||||
$('body').append(this.popupContent);
|
|
||||||
}
|
|
||||||
|
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
var $popup = $(`#${this.popupId}`);
|
var $popup = $(`#${this.popupId}`);
|
||||||
$popup.modal({ backdrop: false });
|
$popup.modal({ backdrop: false });
|
||||||
|
|
||||||
$popup.on('shown.bs.modal', function() {
|
$popup.one('shown.bs.modal', function() {
|
||||||
var $cropContainer = $popup.find('[data-jcrop]');
|
var $cropContainer = $popup.find('[data-jcrop]');
|
||||||
|
|
||||||
var imageElement = new Image();
|
var imageElement = new Image();
|
||||||
|
@ -60,7 +58,7 @@ export default {
|
||||||
});
|
});
|
||||||
|
|
||||||
$popup.off('hidden.bs.modal').one('hidden.bs.modal', () => {
|
$popup.off('hidden.bs.modal').one('hidden.bs.modal', () => {
|
||||||
$popup.modal('hide');
|
$popup.remove();
|
||||||
|
|
||||||
reject(null);
|
reject(null);
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue