Skip to content

Commit

Permalink
Merge pull request #365 from gzot/develop
Browse files Browse the repository at this point in the history
Fix issue #300
  • Loading branch information
MichMich committed Jun 27, 2016
2 parents 479ceb1 + 1b9daa0 commit 491bbac
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ This project adheres to [Semantic Versioning](http://semver.org/).
- Polish Translation

### Fixed
- Edit Alert Module to display title & message if they are provided in the notification (Issue #300)

### Changed
- Added default string to calendar titleReplace.
Expand Down
29 changes: 26 additions & 3 deletions modules/default/alert/alert.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,20 @@ Module.register("alert",{
},
show_notification: function(message) {
if (this.config.effect == "slide") {this.config.effect = this.config.effect + "-" + this.config.position;}
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>";

msg = "";
if (message.title) {
msg += "<span class='thin' style='line-height: 35px; font-size:24px' color='#4A4A4A'>" + message.title + "</span>";
}
if (message.message){
if (msg != ""){
msg+= "<br />";
}
msg += "<span class='light' style='font-size:28px;line-height: 30px;'>" + message.message + "</span>";
}

new NotificationFx({
message: message,
message: msg,
layout: "growl",
effect: this.config.effect,
ttl: this.config.display_time
Expand Down Expand Up @@ -67,7 +78,19 @@ Module.register("alert",{
this.hide_alert(sender);
}

message = "<span class='light' style='line-height: 35px; font-size:30px' color='#4A4A4A'>" + params.title + "</span><br /><span class='thin' style='font-size:22px;line-height: 30px;'>" + params.message + "</span>";
//Display title and message only if they are provided in notification parameters
message ="";
if (params.title) {
message += "<span class='light' style='line-height: 35px; font-size:30px' color='#4A4A4A'>" + params.title + "</span>"
}
if (params.message) {
if (message != ""){
message += "<br />";
}

message += "<span class='thin' style='font-size:22px;line-height: 30px;'>" + params.message + "</span>";
}

//Store alert in this.alerts
this.alerts[sender.name] = new NotificationFx({
message: image + message,
Expand Down

0 comments on commit 491bbac

Please sign in to comment.