Fix regression causing 'undefined' to show up when config.hideTemp is false

This commit is contained in:
Jon Kolb 2020-01-24 10:42:45 -05:00
parent 50b4d05ef5
commit 6ba5056c96

View File

@ -195,11 +195,6 @@ Module.register("currentweather",{
var large = document.createElement("div");
large.className = "large light";
if (this.config.hideTemp === true) {
var weatherIcon = document.createElement("span");
weatherIcon.className = "wi weathericon " + this.weatherType;
large.appendChild(weatherIcon);
var degreeLabel = "";
if (this.config.units === "metric" || this.config.units === "imperial") {
degreeLabel += "°";
@ -222,6 +217,11 @@ Module.register("currentweather",{
this.config.decimalSymbol = ".";
}
if (this.config.hideTemp === true) {
var weatherIcon = document.createElement("span");
weatherIcon.className = "wi weathericon " + this.weatherType;
large.appendChild(weatherIcon);
var temperature = document.createElement("span");
temperature.className = "bright";
temperature.innerHTML = " " + this.temperature.replace(".", this.config.decimalSymbol) + degreeLabel;