mirror of
https://github.com/beestat/app.git
synced 2025-06-03 05:36:51 -04:00
Maybe fixed modal flicker bug
This commit is contained in:
parent
1b33b34d18
commit
a8b7150246
@ -74,7 +74,7 @@ beestat.component.modal.prototype.decorate_ = function() {
|
|||||||
* Fade in the mask
|
* Fade in the mask
|
||||||
* Overpop the modal
|
* Overpop the modal
|
||||||
*/
|
*/
|
||||||
window.setTimeout(function() {
|
this.timeout_1_ = window.setTimeout(function() {
|
||||||
$('body').firstElementChild()
|
$('body').firstElementChild()
|
||||||
.style('filter', 'blur(3px)');
|
.style('filter', 'blur(3px)');
|
||||||
mask.style('background', 'rgba(0, 0, 0, 0.5)');
|
mask.style('background', 'rgba(0, 0, 0, 0.5)');
|
||||||
@ -82,9 +82,9 @@ beestat.component.modal.prototype.decorate_ = function() {
|
|||||||
}, 0);
|
}, 0);
|
||||||
|
|
||||||
// Pop the modal back to normal size
|
// Pop the modal back to normal size
|
||||||
window.setTimeout(function() {
|
this.timeout_2_ = window.setTimeout(function() {
|
||||||
modal.style('transform', 'translateX(-50%) scale(1)');
|
modal.style('transform', 'translateX(-50%) scale(1)');
|
||||||
}, 200);
|
}, 250);
|
||||||
|
|
||||||
// Escape to close
|
// Escape to close
|
||||||
$(window).addEventListener('keydown.modal', function(e) {
|
$(window).addEventListener('keydown.modal', function(e) {
|
||||||
@ -112,6 +112,9 @@ beestat.component.modal.prototype.dispose = function() {
|
|||||||
if (this.rendered_ === true) {
|
if (this.rendered_ === true) {
|
||||||
var self = this;
|
var self = this;
|
||||||
|
|
||||||
|
window.clearTimeout(this.timeout_1_);
|
||||||
|
window.clearTimeout(this.timeout_2_);
|
||||||
|
|
||||||
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()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user