dom-notifications icon indicating copy to clipboard operation
dom-notifications copied to clipboard

Automatically clear notifications

Open finnp opened this issue 9 years ago • 3 comments

  • 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/

finnp avatar Jul 19 '16 15:07 finnp

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)

drschwabe avatar Apr 25 '19 03:04 drschwabe

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.

finnp avatar Apr 25 '19 07:04 finnp

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.

drschwabe avatar Apr 25 '19 17:04 drschwabe