dom-notifications
dom-notifications copied to clipboard
Automatically clear notifications
- Optional behavior
- Show a progress bar that hows when the notification is going to disappear
- When a user hovers over the notification with the mouse, the timer is stopped
- use css from http://stonecircle.github.io/ember-cli-notifications/
A little late here - and I'm not sure how to do this in your current version - but I just forked v1.1.1 and made a one line commit to accommodate for this functionality:
https://github.com/drschwabe/dom-notifications/commit/373a980d1de62234c587462e91b0dc2923abf393
so to use it, you can do:
notifications.add('Something cool happened.')
//get reference to this notification:
let notification = notifications.state[notifications.state.length - 1]
//allow notification to appear for a few seconds, set as closed...
setTimeout( () => {
notification.closed = true
notifications.update()
// (notification 'animates' out in the same way as if user closed it with 'x' button )
}, 3500)
Are you interested in taking over this project? I'm currently not using it anywhere. This project is using semantic-release, so if i add you on github you're free to publish your changes as a new feature release.
Well this feature is based on your v1.1.1 commit so my fork may be fine in this way your changes since that point are preserved.