mirror of
https://github.com/beestat/app.git
synced 2025-05-31 04:06:32 -04:00
Fixed #262 - Closing a modal while it's saving and before it's closed errors.
This commit is contained in:
parent
a0b8b45057
commit
092ed81ac9
@ -143,25 +143,27 @@ beestat.component.modal.prototype.decorate_ = function() {
|
|||||||
* Close the currently open modal.
|
* Close the currently open modal.
|
||||||
*/
|
*/
|
||||||
beestat.component.modal.prototype.dispose = function() {
|
beestat.component.modal.prototype.dispose = function() {
|
||||||
var self = this;
|
if (this.rendered_ === true) {
|
||||||
|
var self = this;
|
||||||
|
|
||||||
this.modal_.style('transform', 'translateX(-50%) scale(0)');
|
this.modal_.style('transform', 'translateX(-50%) scale(0)');
|
||||||
this.mask_.style('background', 'rgba(0, 0, 0, 0)');
|
this.mask_.style('background', 'rgba(0, 0, 0, 0)');
|
||||||
$('body').firstElementChild()
|
$('body').firstElementChild()
|
||||||
.style('filter', '');
|
.style('filter', '');
|
||||||
|
|
||||||
setTimeout(function() {
|
setTimeout(function() {
|
||||||
self.modal_.parentNode().removeChild(self.modal_);
|
self.modal_.parentNode().removeChild(self.modal_);
|
||||||
self.mask_.parentNode().removeChild(self.mask_);
|
self.mask_.parentNode().removeChild(self.mask_);
|
||||||
|
|
||||||
delete self.mask_;
|
delete self.mask_;
|
||||||
delete self.modal_;
|
delete self.modal_;
|
||||||
}, 200);
|
}, 200);
|
||||||
|
|
||||||
$(window).removeEventListener('keydown.modal');
|
$(window).removeEventListener('keydown.modal');
|
||||||
$(window).removeEventListener('click.modal');
|
$(window).removeEventListener('click.modal');
|
||||||
|
|
||||||
this.rendered_ = false;
|
this.rendered_ = false;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user