Skip to content

Commit

Permalink
Merge pull request LukeSkywalker92#33 from codac/master
Browse files Browse the repository at this point in the history
Fixing LukeSkywalker92#29 header display missing while weatherwarnings are available
  • Loading branch information
LukeSkywalker92 authored Nov 23, 2021
2 parents 837e0e9 + 84f9fcf commit 484c432
Showing 1 changed file with 15 additions and 6 deletions.
21 changes: 15 additions & 6 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 @@ -166,19 +163,31 @@ Module.register("MMM-DWD-WarnWeather", {
var duration = document.createElement("div");
duration.className = 'duration';
duration.innerHTML = start + ' - ' + end;
var newLine = document.createElement("br");
var newLine1 = document.createElement("br");
var newLine2 = document.createElement("br");
description.appendChild(headline);
description.appendChild(duration);
warnWrapper.appendChild(icon);
warnWrapper.appendChild(description);
wrapper.appendChild(warnWrapper);
wrapper.appendChild(newLine);

wrapper.appendChild(newLine1);
if (this.warnings.length > 1) {
wrapper.appendChild(newLine2);
}
}

//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 484c432

Please sign in to comment.