From f3aea04bc508bd69eed7153bdcc3a0f4bb238e2e Mon Sep 17 00:00:00 2001 From: Krouty Date: Wed, 24 Nov 2021 10:41:53 +0100 Subject: [PATCH] fix header display part 3 header display missing while weatherwarnings are available --- MMM-DWD-WarnWeather.js | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/MMM-DWD-WarnWeather.js b/MMM-DWD-WarnWeather.js index cedab1d..6d123cd 100644 --- a/MMM-DWD-WarnWeather.js +++ b/MMM-DWD-WarnWeather.js @@ -97,9 +97,6 @@ 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'; @@ -185,6 +182,15 @@ 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) {