mirror of
https://github.com/MichMich/MagicMirror.git
synced 2025-06-27 11:50:00 +00:00
Added text alignment based on position
This commit is contained in:
parent
882e9731ac
commit
f8c1644dee
@ -25,7 +25,7 @@ Module.register('alert',{
|
|||||||
return ['ns-default.css', 'sweetalert.css'];
|
return ['ns-default.css', 'sweetalert.css'];
|
||||||
},
|
},
|
||||||
show_notification: function (message) {
|
show_notification: function (message) {
|
||||||
message = "<font class='thin' style='line-height: 35px; font-size:24px' color='#4A4A4A'>" + message.title + "</font><br /><font class='light' style='font-size:28px;line-height: 30px;'>" + message.message + "</font>"
|
message = "<span class='thin' style='line-height: 35px; font-size:24px' color='#4A4A4A'>" + message.title + "</span><br /><span class='light' style='font-size:28px;line-height: 30px;'>" + message.message + "</span>"
|
||||||
new NotificationFx({
|
new NotificationFx({
|
||||||
message : message,
|
message : message,
|
||||||
layout : "growl",
|
layout : "growl",
|
||||||
@ -54,9 +54,9 @@ Module.register('alert',{
|
|||||||
},
|
},
|
||||||
setPosition: function (pos) {
|
setPosition: function (pos) {
|
||||||
var sheet = document.createElement('style')
|
var sheet = document.createElement('style')
|
||||||
if (pos == "center"){sheet.innerHTML = ".ns-box {margin-left: auto; margin-right: auto;}";}
|
if (pos == "center"){sheet.innerHTML = ".ns-box {margin-left: auto; margin-right: auto;text-align: center;}";}
|
||||||
if (pos == "right"){sheet.innerHTML = ".ns-box {margin-left: auto;}";}
|
if (pos == "right"){sheet.innerHTML = ".ns-box {margin-left: auto;text-align: right;}";}
|
||||||
if (pos == "left"){sheet.innerHTML = ".ns-box {margin-right: auto;}";}
|
if (pos == "left"){sheet.innerHTML = ".ns-box {margin-right: auto;text-align: left;}";}
|
||||||
document.body.appendChild(sheet);
|
document.body.appendChild(sheet);
|
||||||
|
|
||||||
},
|
},
|
||||||
@ -73,7 +73,7 @@ Module.register('alert',{
|
|||||||
},
|
},
|
||||||
start: function() {
|
start: function() {
|
||||||
if (this.config.welcome_message){
|
if (this.config.welcome_message){
|
||||||
this.show_notification({title: "Welcome", message: this.config.welcome_message})
|
this.show_notification({title: "MagicMirror Notification", message: this.config.welcome_message})
|
||||||
}
|
}
|
||||||
this.setPosition(this.config.position)
|
this.setPosition(this.config.position)
|
||||||
Log.info('Starting module: ' + this.name);
|
Log.info('Starting module: ' + this.name);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user