Skip to content

Commit

Permalink
Merge branch 'master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
codac authored Nov 23, 2021
2 parents 910c3a3 + 76e490b commit adc195f
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions MMM-DWD-WarnWeather.js
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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);
Expand All @@ -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) {

Expand Down

0 comments on commit adc195f

Please sign in to comment.