Skip to content

Commit

Permalink
Support timer in notifications too
Browse files Browse the repository at this point in the history
  • Loading branch information
qistoph committed Mar 14, 2019
1 parent 4203065 commit c0ab2ac
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ This project adheres to [Semantic Versioning](http://semver.org/).
- Added option to split multiple day events in calendar to separate numbered events
- Slovakian translation
- Alerts now can contain Font Awesome icons
- Notifications display time can be set in request

### Updated
- Bumped the Electron dependency to v3.0.13 to support the most recent Raspbian. [#1500](https://github.com/MichMich/MagicMirror/issues/1500)
Expand Down
9 changes: 5 additions & 4 deletions modules/default/alert/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,11 @@ self.sendNotification("SHOW_ALERT", {});
```

### Notification params
| Option | Description
| --------- | -----------
| `title` | The title of the notification. <br><br> **Possible values:** `text` or `html`
| `message` | The message of the notification. <br><br> **Possible values:** `text` or `html`
| Option | Description
| ------------------ | -----------
| `title` | The title of the notification. <br><br> **Possible values:** `text` or `html`
| `message` | The message of the notification. <br><br> **Possible values:** `text` or `html`
| `timer` (optional) | How long the notification should stay visible in ms. <br> If absent, the default `display_time` is used. <br> **Possible values:** `int` `float`


### Alert params
Expand Down
2 changes: 1 addition & 1 deletion modules/default/alert/alert.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ Module.register("alert",{
message: msg,
layout: "growl",
effect: this.config.effect,
ttl: this.config.display_time
ttl: message.timer !== undefined ? message.timer : this.config.display_time
}).show();
},
show_alert: function(params, sender) {
Expand Down

0 comments on commit c0ab2ac

Please sign in to comment.