diff --git a/MMM-DWD-WarnWeather.js b/MMM-DWD-WarnWeather.js index 12c73a9..cedab1d 100644 --- a/MMM-DWD-WarnWeather.js +++ b/MMM-DWD-WarnWeather.js @@ -97,6 +97,9 @@ Module.register("MMM-DWD-WarnWeather", { if (this.config.displayInnerHeader) { wrapper.appendChild(header); } + if (this.warnings.length < 1 && this.config.hideNoWarning) { + this.data.header = ''; + } var locNotFound = document.createElement("div"); locNotFound.className = 'locationNotFound'; @@ -163,13 +166,16 @@ Module.register("MMM-DWD-WarnWeather", { var duration = document.createElement("div"); duration.className = 'duration'; duration.innerHTML = start + ' - ' + end; + var newLineSingleWarning = document.createElement("br"); var newLineMultipleWarning = document.createElement("br"); + description.appendChild(headline); description.appendChild(duration); warnWrapper.appendChild(icon); warnWrapper.appendChild(description); wrapper.appendChild(warnWrapper); + wrapper.appendChild(newLineSingleWarning); if (this.warnings.length > 1) { wrapper.appendChild(newLineMultipleWarning); @@ -179,15 +185,6 @@ Module.register("MMM-DWD-WarnWeather", { //Log.info(wrapper); return wrapper; }, - - getHeader: function () { - if (this.warnings.length < 1 && this.config.hideNoWarning) { - if (this.data.header) return ""; - else return ""; - } else { - return this.data.header; - } - }, wordwrap: function (str, width, brk) {