1
0
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:
Jon Ziebell 2021-01-22 22:56:23 -05:00
parent bd1554687a
commit 96403884f7
12 changed files with 19 additions and 19 deletions

View File

@ -75,7 +75,7 @@ beestat.api.prototype.send = function(opt_api_call) {
* problems. * problems.
*/ */
if (this.callback_ !== undefined) { if (this.callback_ !== undefined) {
setTimeout(function() { window.setTimeout(function() {
self.callback_(self.cached_batch_api_calls_); self.callback_(self.cached_batch_api_calls_);
}, 0); }, 0);
} }
@ -94,7 +94,7 @@ beestat.api.prototype.send = function(opt_api_call) {
* callback, the rerender can happen during a render which causes * callback, the rerender can happen during a render which causes
* problems. * problems.
*/ */
setTimeout(function() { window.setTimeout(function() {
self.callback_(cached.data); self.callback_(cached.data);
}, 0); }, 0);
} }

View File

@ -24,8 +24,8 @@ beestat.debounce = function(func, wait, immediate) {
} }
}; };
var callNow = immediate && !timeout; var callNow = immediate && !timeout;
clearTimeout(timeout); window.clearTimeout(timeout);
timeout = setTimeout(later, wait); timeout = window.setTimeout(later, wait);
if (callNow) { if (callNow) {
func.apply(self, args); func.apply(self, args);
} }

View File

@ -39,7 +39,7 @@ beestat.component.prototype.render = function(parent) {
} }
// The element should now exist on the DOM. // The element should now exist on the DOM.
setTimeout(function() { window.setTimeout(function() {
self.dispatchEvent('render'); self.dispatchEvent('render');
}, 0); }, 0);
@ -67,7 +67,7 @@ beestat.component.prototype.rerender = function() {
this.component_container_ = new_container; this.component_container_ = new_container;
var self = this; var self = this;
setTimeout(function() { window.setTimeout(function() {
self.dispatchEvent('render'); self.dispatchEvent('render');
}, 0); }, 0);
} }

View File

@ -357,7 +357,7 @@ beestat.component.alert.prototype.show = function() {
'padding-bottom': (beestat.style.size.gutter / 2) 'padding-bottom': (beestat.style.size.gutter / 2)
}); });
setTimeout(function() { window.setTimeout(function() {
self.alert_main_.style('height', 'auto'); self.alert_main_.style('height', 'auto');
}, 200); }, 200);
} }
@ -398,7 +398,7 @@ beestat.component.alert.prototype.hide = function() {
this.height_ = this.alert_main_.getBoundingClientRect().height; this.height_ = this.alert_main_.getBoundingClientRect().height;
this.alert_main_.style('height', this.height_); this.alert_main_.style('height', this.height_);
setTimeout(function() { window.setTimeout(function() {
self.alert_main_.style({ self.alert_main_.style({
'height': '0', 'height': '0',
'padding-top': '0', 'padding-top': '0',

View File

@ -20,7 +20,7 @@ beestat.component.card.patreon.prototype.decorate_contents_ = function(parent) {
// Don't render anything if the user is an active Patron. // Don't render anything if the user is an active Patron.
if (beestat.component.card.patreon.should_show() === false) { if (beestat.component.card.patreon.should_show() === false) {
setTimeout(function() { window.setTimeout(function() {
self.dispose(); self.dispose();
}, 0); }, 0);
return; return;

View File

@ -220,7 +220,7 @@ beestat.component.card.runtime_sensor_detail.prototype.decorate_contents_ = func
} }
} else { } else {
this.show_loading_('Syncing'); this.show_loading_('Syncing');
setTimeout(function() { window.setTimeout(function() {
new beestat.api() new beestat.api()
.add_call( .add_call(
'thermostat', 'thermostat',

View File

@ -208,7 +208,7 @@ beestat.component.card.runtime_thermostat_detail.prototype.decorate_contents_ =
} }
} else { } else {
this.show_loading_('Syncing'); this.show_loading_('Syncing');
setTimeout(function() { window.setTimeout(function() {
new beestat.api() new beestat.api()
.add_call( .add_call(
'thermostat', 'thermostat',

View File

@ -99,7 +99,7 @@ beestat.component.card.runtime_thermostat_summary.prototype.decorate_contents_ =
} }
this.show_loading_('Syncing (' + sync_progress + '%)<br/>' + string_remain + ' remaining'); this.show_loading_('Syncing (' + sync_progress + '%)<br/>' + string_remain + ' remaining');
setTimeout(function() { window.setTimeout(function() {
var api = new beestat.api(); var api = new beestat.api();
api.add_call( api.add_call(
'runtime_thermostat_summary', 'runtime_thermostat_summary',

View File

@ -120,7 +120,7 @@ beestat.component.chart.prototype.get_options_plotOptions_ = function() {
'events': { 'events': {
'legendItemClick': function() { 'legendItemClick': function() {
// Delay the event dispatch so the series is actually toggled to the correct visibility. // Delay the event dispatch so the series is actually toggled to the correct visibility.
setTimeout(function() { window.setTimeout(function() {
self.dispatchEvent('legend_item_click'); self.dispatchEvent('legend_item_click');
}, 0); }, 0);
} }

View File

@ -47,7 +47,7 @@ beestat.component.menu.prototype.dispose = function() {
container.style('transform', 'scale(0)'); container.style('transform', 'scale(0)');
delete beestat.component.menu.open_menu; delete beestat.component.menu.open_menu;
setTimeout(function() { window.setTimeout(function() {
self.menu_items_.forEach(function(menu_item) { self.menu_items_.forEach(function(menu_item) {
menu_item.dispose(); 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. // Transition the element in after it's been placed on the page.
setTimeout(function() { window.setTimeout(function() {
container.style('transform', 'scale(1)'); container.style('transform', 'scale(1)');
/* /*

View File

@ -74,7 +74,7 @@ beestat.component.modal.prototype.decorate_ = function() {
* Fade in the mask * Fade in the mask
* Overpop the modal * Overpop the modal
*/ */
setTimeout(function() { 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,7 +82,7 @@ beestat.component.modal.prototype.decorate_ = function() {
}, 0); }, 0);
// Pop the modal back to normal size // Pop the modal back to normal size
setTimeout(function() { window.setTimeout(function() {
modal.style('transform', 'translateX(-50%) scale(1)'); modal.style('transform', 'translateX(-50%) scale(1)');
}, 200); }, 200);
@ -117,7 +117,7 @@ beestat.component.modal.prototype.dispose = function() {
$('body').firstElementChild() $('body').firstElementChild()
.style('filter', ''); .style('filter', '');
setTimeout(function() { window.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_);

View File

@ -50,7 +50,7 @@ beestat.component.modal.patreon_status.prototype.decorate_wait_ = function(paren
self.rerender(); self.rerender();
}); });
setTimeout(function() { window.setTimeout(function() {
api.send(); api.send();
}, 5000); }, 5000);
}; };