mirror of
https://github.com/MichMich/MagicMirror.git
synced 2025-08-21 12:55:22 +00:00
Use 'white-space: pre-line' for multi-line compliment.
This commit is contained in:
@@ -157,15 +157,10 @@ Module.register("compliments", {
|
||||
getDom: function() {
|
||||
var complimentText = this.randomCompliment();
|
||||
|
||||
var compliment = document.createTextNode(complimentText);
|
||||
var wrapper = document.createElement("div");
|
||||
wrapper.className = this.config.classes ? this.config.classes : "thin xlarge bright";
|
||||
complimentText.split("\n").forEach(function(line, index) {
|
||||
if (index > 0) {
|
||||
wrapper.appendChild(document.createElement("br"));
|
||||
}
|
||||
wrapper.appendChild(document.createTextNode(line));
|
||||
|
||||
});
|
||||
wrapper.className = this.config.classes ? this.config.classes : "thin xlarge bright pre-line";
|
||||
wrapper.appendChild(compliment);
|
||||
|
||||
return wrapper;
|
||||
},
|
||||
|
Reference in New Issue
Block a user