set weather updates on an interval

This commit is contained in:
Jon Heller 2015-10-18 22:13:59 -04:00
parent fc4e916a99
commit 0dee9c0bd9

View File

@ -135,16 +135,17 @@ weather.updateWeatherForecast = function () {
weather.init = function () { weather.init = function () {
if (weather.params.lang === undefined) { if (this.params.lang === undefined) {
weather.params.lang = weather.lang; this.params.lang = this.lang;
} }
if (weather.params.cnt === undefined) { if (this.params.cnt === undefined) {
weather.params.cnt = 5; this.params.cnt = 5;
} }
weather.updateCurrentWeather(); this.intervalId = setInterval(function () {
this.updateCurrentWeather();
weather.updateWeatherForecast(); this.updateWeatherForecast();
}.bind(this), this.updateInterval);
} }