Skip to content

Commit

Permalink
fix header display part 3
Browse files Browse the repository at this point in the history
header display missing while weatherwarnings are available
  • Loading branch information
codac authored Nov 24, 2021
1 parent adc195f commit f3aea04
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions MMM-DWD-WarnWeather.js
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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) {

Expand Down

0 comments on commit f3aea04

Please sign in to comment.