mirror of
https://github.com/beestat/app.git
synced 2025-07-09 03:04:07 -04:00
Changed all timeout calls to explicitly declare window
This commit is contained in:
parent
bd1554687a
commit
96403884f7
@ -75,7 +75,7 @@ beestat.api.prototype.send = function(opt_api_call) {
|
||||
* problems.
|
||||
*/
|
||||
if (this.callback_ !== undefined) {
|
||||
setTimeout(function() {
|
||||
window.setTimeout(function() {
|
||||
self.callback_(self.cached_batch_api_calls_);
|
||||
}, 0);
|
||||
}
|
||||
@ -94,7 +94,7 @@ beestat.api.prototype.send = function(opt_api_call) {
|
||||
* callback, the rerender can happen during a render which causes
|
||||
* problems.
|
||||
*/
|
||||
setTimeout(function() {
|
||||
window.setTimeout(function() {
|
||||
self.callback_(cached.data);
|
||||
}, 0);
|
||||
}
|
||||
|
@ -24,8 +24,8 @@ beestat.debounce = function(func, wait, immediate) {
|
||||
}
|
||||
};
|
||||
var callNow = immediate && !timeout;
|
||||
clearTimeout(timeout);
|
||||
timeout = setTimeout(later, wait);
|
||||
window.clearTimeout(timeout);
|
||||
timeout = window.setTimeout(later, wait);
|
||||
if (callNow) {
|
||||
func.apply(self, args);
|
||||
}
|
||||
|
@ -39,7 +39,7 @@ beestat.component.prototype.render = function(parent) {
|
||||
}
|
||||
|
||||
// The element should now exist on the DOM.
|
||||
setTimeout(function() {
|
||||
window.setTimeout(function() {
|
||||
self.dispatchEvent('render');
|
||||
}, 0);
|
||||
|
||||
@ -67,7 +67,7 @@ beestat.component.prototype.rerender = function() {
|
||||
this.component_container_ = new_container;
|
||||
|
||||
var self = this;
|
||||
setTimeout(function() {
|
||||
window.setTimeout(function() {
|
||||
self.dispatchEvent('render');
|
||||
}, 0);
|
||||
}
|
||||
|
@ -357,7 +357,7 @@ beestat.component.alert.prototype.show = function() {
|
||||
'padding-bottom': (beestat.style.size.gutter / 2)
|
||||
});
|
||||
|
||||
setTimeout(function() {
|
||||
window.setTimeout(function() {
|
||||
self.alert_main_.style('height', 'auto');
|
||||
}, 200);
|
||||
}
|
||||
@ -398,7 +398,7 @@ beestat.component.alert.prototype.hide = function() {
|
||||
this.height_ = this.alert_main_.getBoundingClientRect().height;
|
||||
this.alert_main_.style('height', this.height_);
|
||||
|
||||
setTimeout(function() {
|
||||
window.setTimeout(function() {
|
||||
self.alert_main_.style({
|
||||
'height': '0',
|
||||
'padding-top': '0',
|
||||
|
@ -20,7 +20,7 @@ beestat.component.card.patreon.prototype.decorate_contents_ = function(parent) {
|
||||
|
||||
// Don't render anything if the user is an active Patron.
|
||||
if (beestat.component.card.patreon.should_show() === false) {
|
||||
setTimeout(function() {
|
||||
window.setTimeout(function() {
|
||||
self.dispose();
|
||||
}, 0);
|
||||
return;
|
||||
|
@ -220,7 +220,7 @@ beestat.component.card.runtime_sensor_detail.prototype.decorate_contents_ = func
|
||||
}
|
||||
} else {
|
||||
this.show_loading_('Syncing');
|
||||
setTimeout(function() {
|
||||
window.setTimeout(function() {
|
||||
new beestat.api()
|
||||
.add_call(
|
||||
'thermostat',
|
||||
|
@ -208,7 +208,7 @@ beestat.component.card.runtime_thermostat_detail.prototype.decorate_contents_ =
|
||||
}
|
||||
} else {
|
||||
this.show_loading_('Syncing');
|
||||
setTimeout(function() {
|
||||
window.setTimeout(function() {
|
||||
new beestat.api()
|
||||
.add_call(
|
||||
'thermostat',
|
||||
|
@ -99,7 +99,7 @@ beestat.component.card.runtime_thermostat_summary.prototype.decorate_contents_ =
|
||||
}
|
||||
|
||||
this.show_loading_('Syncing (' + sync_progress + '%)<br/>' + string_remain + ' remaining');
|
||||
setTimeout(function() {
|
||||
window.setTimeout(function() {
|
||||
var api = new beestat.api();
|
||||
api.add_call(
|
||||
'runtime_thermostat_summary',
|
||||
|
@ -120,7 +120,7 @@ beestat.component.chart.prototype.get_options_plotOptions_ = function() {
|
||||
'events': {
|
||||
'legendItemClick': function() {
|
||||
// Delay the event dispatch so the series is actually toggled to the correct visibility.
|
||||
setTimeout(function() {
|
||||
window.setTimeout(function() {
|
||||
self.dispatchEvent('legend_item_click');
|
||||
}, 0);
|
||||
}
|
||||
|
@ -47,7 +47,7 @@ beestat.component.menu.prototype.dispose = function() {
|
||||
container.style('transform', 'scale(0)');
|
||||
|
||||
delete beestat.component.menu.open_menu;
|
||||
setTimeout(function() {
|
||||
window.setTimeout(function() {
|
||||
self.menu_items_.forEach(function(menu_item) {
|
||||
menu_item.dispose();
|
||||
});
|
||||
@ -94,7 +94,7 @@ beestat.component.menu.prototype.open_ = function() {
|
||||
});
|
||||
|
||||
// Transition the element in after it's been placed on the page.
|
||||
setTimeout(function() {
|
||||
window.setTimeout(function() {
|
||||
container.style('transform', 'scale(1)');
|
||||
|
||||
/*
|
||||
|
@ -74,7 +74,7 @@ beestat.component.modal.prototype.decorate_ = function() {
|
||||
* Fade in the mask
|
||||
* Overpop the modal
|
||||
*/
|
||||
setTimeout(function() {
|
||||
window.setTimeout(function() {
|
||||
$('body').firstElementChild()
|
||||
.style('filter', 'blur(3px)');
|
||||
mask.style('background', 'rgba(0, 0, 0, 0.5)');
|
||||
@ -82,7 +82,7 @@ beestat.component.modal.prototype.decorate_ = function() {
|
||||
}, 0);
|
||||
|
||||
// Pop the modal back to normal size
|
||||
setTimeout(function() {
|
||||
window.setTimeout(function() {
|
||||
modal.style('transform', 'translateX(-50%) scale(1)');
|
||||
}, 200);
|
||||
|
||||
@ -117,7 +117,7 @@ beestat.component.modal.prototype.dispose = function() {
|
||||
$('body').firstElementChild()
|
||||
.style('filter', '');
|
||||
|
||||
setTimeout(function() {
|
||||
window.setTimeout(function() {
|
||||
self.modal_.parentNode().removeChild(self.modal_);
|
||||
self.mask_.parentNode().removeChild(self.mask_);
|
||||
|
||||
|
@ -50,7 +50,7 @@ beestat.component.modal.patreon_status.prototype.decorate_wait_ = function(paren
|
||||
self.rerender();
|
||||
});
|
||||
|
||||
setTimeout(function() {
|
||||
window.setTimeout(function() {
|
||||
api.send();
|
||||
}, 5000);
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user