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:
@@ -128,6 +128,10 @@ sup {
|
|||||||
text-overflow: ellipsis;
|
text-overflow: ellipsis;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.pre-line {
|
||||||
|
white-space: pre-line;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Region Definitions.
|
* Region Definitions.
|
||||||
*/
|
*/
|
||||||
|
@@ -157,15 +157,10 @@ Module.register("compliments", {
|
|||||||
getDom: function() {
|
getDom: function() {
|
||||||
var complimentText = this.randomCompliment();
|
var complimentText = this.randomCompliment();
|
||||||
|
|
||||||
|
var compliment = document.createTextNode(complimentText);
|
||||||
var wrapper = document.createElement("div");
|
var wrapper = document.createElement("div");
|
||||||
wrapper.className = this.config.classes ? this.config.classes : "thin xlarge bright";
|
wrapper.className = this.config.classes ? this.config.classes : "thin xlarge bright pre-line";
|
||||||
complimentText.split("\n").forEach(function(line, index) {
|
wrapper.appendChild(compliment);
|
||||||
if (index > 0) {
|
|
||||||
wrapper.appendChild(document.createElement("br"));
|
|
||||||
}
|
|
||||||
wrapper.appendChild(document.createTextNode(line));
|
|
||||||
|
|
||||||
});
|
|
||||||
|
|
||||||
return wrapper;
|
return wrapper;
|
||||||
},
|
},
|
||||||
|
Reference in New Issue
Block a user