diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 85b24d5..a5916b7 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -12,16 +12,7 @@ If you have a good idea for improvement feel free to create a new issue with all ### Issues -Feel free to grab any open issue implement it and create a new pull request. Most issues can be found in the code and have the following structure: - -```js -/** - * @todo Orange-Management/Orange-Management#ISSUE_NUMBER [d:difficulty] - * Description for the issue - */ -``` - -The issue information can be used to provide additional information such as priority, difficulty and type. For your first issue try to find a issue marked `[d:first]` or `[d:beginner]`. +Feel free to grab any open issue implement it and create a new pull request. Most issues can be found in the code marked with `@todo` or in the [PROJECT.md](https://github.com/Orange-Management/Docs/blob/master/Project/PROJECT.md) file. ### Code Style @@ -31,6 +22,6 @@ Not always are the defined coding style standards upheld, if you notice that sim While code coverage is just a metric it is still appreciated to cover as many files and code paths as possible. Just have a look at the code coverage and implement missing unit tests. -### Freatures +### Features You have a good idea for a feature and can implement it yourself, go ahead and create a new pull request. \ No newline at end of file diff --git a/Message/Notification/App/AppNotification.js b/Message/Notification/App/AppNotification.js index e67daa9..5774466 100644 --- a/Message/Notification/App/AppNotification.js +++ b/Message/Notification/App/AppNotification.js @@ -51,12 +51,24 @@ export class AppNotification let output = document.importNode(tpl.content, true); output.querySelector('.log-msg').classList.add('log-msg-status-' + msg.status); - output.querySelector('.log-msg-title').innerHTML = msg.title; output.querySelector('.log-msg-content').innerHTML = msg.message; + output.querySelector('.close').addEventListeenr('click', function() { + this.parent.remove(); + }); + + if (msg.title && msg.title !== '') { + output.querySelector('.log-msg-title').innerHTML = msg.title; + } else { + output.querySelector('.log-msg-title').remove(); + } tpl.parentNode.appendChild(output); window.navigator.vibrate(msg.vibrate ? 200 : 0); + if (msg.isSticky) { + return; + } + setTimeout(function () { document.getElementsByClassName('log-msg')[0].remove(); diff --git a/Message/Notification/NotificationMessage.js b/Message/Notification/NotificationMessage.js index 1a4a9bb..a0b57f3 100644 --- a/Message/Notification/NotificationMessage.js +++ b/Message/Notification/NotificationMessage.js @@ -18,11 +18,12 @@ export class NotificationMessage * * @since 1.0.0 */ - constructor(status, title, message, vibrate = false) + constructor(status, title, message, vibrate = false, isSticky = false) { - this.status = status; - this.title = title; - this.message = message; - this.vibrate = vibrate + this.status = status; + this.title = title; + this.message = message; + this.vibrate = vibrate + this.isSticky = isSticky }; }; \ No newline at end of file