1
0
mirror of https://github.com/beestat/app.git synced 2025-05-24 02:14:03 -04:00

Maybe fixed modal flicker bug

This commit is contained in:
Jon Ziebell 2022-08-10 21:50:51 -04:00
parent 1b33b34d18
commit a8b7150246

View File

@ -74,7 +74,7 @@ beestat.component.modal.prototype.decorate_ = function() {
* Fade in the mask
* Overpop the modal
*/
window.setTimeout(function() {
this.timeout_1_ = window.setTimeout(function() {
$('body').firstElementChild()
.style('filter', 'blur(3px)');
mask.style('background', 'rgba(0, 0, 0, 0.5)');
@ -82,9 +82,9 @@ beestat.component.modal.prototype.decorate_ = function() {
}, 0);
// Pop the modal back to normal size
window.setTimeout(function() {
this.timeout_2_ = window.setTimeout(function() {
modal.style('transform', 'translateX(-50%) scale(1)');
}, 200);
}, 250);
// Escape to close
$(window).addEventListener('keydown.modal', function(e) {
@ -112,6 +112,9 @@ beestat.component.modal.prototype.dispose = function() {
if (this.rendered_ === true) {
var self = this;
window.clearTimeout(this.timeout_1_);
window.clearTimeout(this.timeout_2_);
this.modal_.style('transform', 'translateX(-50%) scale(0)');
this.mask_.style('background', 'rgba(0, 0, 0, 0)');
$('body').firstElementChild()