diff --git a/modules/default/currentweather/currentweather.js b/modules/default/currentweather/currentweather.js index d9d06ccb..0a43b23e 100644 --- a/modules/default/currentweather/currentweather.js +++ b/modules/default/currentweather/currentweather.js @@ -37,6 +37,8 @@ Module.register("currentweather", { weatherEndpoint: "weather", appendLocationNameToHeader: true, + useLocationAsHeader: false, + calendarClass: "calendar", tableClass: "large", @@ -267,15 +269,16 @@ Module.register("currentweather", { // Override getHeader method. getHeader: function () { - if (this.config.appendLocationNameToHeader && this.data.header !== undefined) { - return this.data.header + " " + this.fetchedLocationName; - } - if (this.config.useLocationAsHeader && this.config.location !== false) { return this.config.location; } - return this.data.header; + if (this.config.appendLocationNameToHeader) { + if (this.data.header) return this.data.header + " " + this.fetchedLocationName; + else return this.fetchedLocationName; + } + + return this.data.header ? this.data.header : ""; }, // Override notification handler. diff --git a/modules/default/weather/weather.js b/modules/default/weather/weather.js index 73c493e0..b1346a48 100644 --- a/modules/default/weather/weather.js +++ b/modules/default/weather/weather.js @@ -73,11 +73,12 @@ Module.register("weather", { // Override getHeader method. getHeader: function () { - if (this.config.appendLocationNameToHeader && this.data.header !== undefined && this.weatherProvider) { - return this.data.header + " " + this.weatherProvider.fetchedLocation(); + if (this.config.appendLocationNameToHeader && this.weatherProvider) { + if (this.data.header) return this.data.header + " " + this.weatherProvider.fetchedLocation(); + else return this.weatherProvider.fetchedLocation(); } - return this.data.header; + return this.data.header ? this.data.header : ""; }, // Start the weather module. diff --git a/modules/default/weatherforecast/weatherforecast.js b/modules/default/weatherforecast/weatherforecast.js index 511d226f..4ecc18aa 100644 --- a/modules/default/weatherforecast/weatherforecast.js +++ b/modules/default/weatherforecast/weatherforecast.js @@ -206,10 +206,11 @@ Module.register("weatherforecast", { // Override getHeader method. getHeader: function () { if (this.config.appendLocationNameToHeader) { - return this.data.header + " " + this.fetchedLocationName; + if (this.data.header) return this.data.header + " " + this.fetchedLocationName; + else return this.fetchedLocationName; } - return this.data.header; + return this.data.header ? this.data.header : ""; }, // Override notification handler.