From c32f0f9bf30aa04167712b8ab08091533baa848c Mon Sep 17 00:00:00 2001 From: LukeSkywalker92 Date: Tue, 23 Nov 2021 16:23:29 +0100 Subject: [PATCH] Revert "Fixing #29 header display missing while weatherwarnings are available" --- MMM-DWD-WarnWeather.js | 21 ++++++--------------- 1 file changed, 6 insertions(+), 15 deletions(-) diff --git a/MMM-DWD-WarnWeather.js b/MMM-DWD-WarnWeather.js index 3ba7be2..6d8dfcd 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,31 +166,19 @@ Module.register("MMM-DWD-WarnWeather", { var duration = document.createElement("div"); duration.className = 'duration'; duration.innerHTML = start + ' - ' + end; - var newLine1 = document.createElement("br"); - var newLine2 = document.createElement("br"); + var newLine = document.createElement("br"); description.appendChild(headline); description.appendChild(duration); warnWrapper.appendChild(icon); warnWrapper.appendChild(description); wrapper.appendChild(warnWrapper); - wrapper.appendChild(newLine1); - if (this.warnings.length > 1) { - wrapper.appendChild(newLine2); - } + wrapper.appendChild(newLine); + } //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) {