Change Class behavior of hello world.

This commit is contained in:
Michael Teeuw
2016-04-09 15:49:39 +02:00
parent 7ef43caa1e
commit 14a72dec15
3 changed files with 7 additions and 19 deletions

View File

@@ -17,9 +17,9 @@ var defaults = {
{
module: "helloworld",
position: "upper_third",
classes: "large thin",
config: {
text: "Magic Mirror<sup>2</sup>",
classes: "large thin"
text: "Magic Mirror<sup>2</sup>"
}
},
{
@@ -32,17 +32,17 @@ var defaults = {
{
module: "helloworld",
position: "middle_center",
classes: "small dimmed",
config: {
text: "See README for more information.",
classes: "small dimmed"
text: "See README for more information."
}
},
{
module: "helloworld",
position: "bottom_bar",
classes: "xsmall dimmed",
config: {
text: "www.michaelteeuw.nl",
classes: "xsmall dimmed"
text: "www.michaelteeuw.nl"
}
},
],

View File

@@ -38,14 +38,5 @@ The following properties can be configured:
<br><b>Default value:</b> <code>'Hello world!'</code>
</td>
</tr>
<tr>
<td><code>classes</code></td>
<td>Classes to apply to the text.<br>
<br><b>Example:</b> <code>'xsmall bold'</code>
<br><b>Default value:</b> <code>'normal medium'</code>
</td>
</tr>
</tbody>
</table>

View File

@@ -11,16 +11,13 @@ Module.register("helloworld",{
// Default module config.
defaults: {
text: "Hello World!",
classes: "normal medium"
text: "Hello World!"
},
// Override dom generator.
getDom: function() {
var wrapper = document.createElement("div");
wrapper.className = this.config.classes;
wrapper.innerHTML = this.config.text;
return wrapper;
}
});