Skip to content

Commit

Permalink
Revert "Fixing LukeSkywalker92#29 header display missing while weathe…
Browse files Browse the repository at this point in the history
…rwarnings are available"
  • Loading branch information
LukeSkywalker92 authored Nov 23, 2021
1 parent 484c432 commit c32f0f9
Showing 1 changed file with 6 additions and 15 deletions.
21 changes: 6 additions & 15 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,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) {

Expand Down

0 comments on commit c32f0f9

Please sign in to comment.