Skip to content

Animated exit

Choose a tag to compare

@poteto poteto released this 25 Jun 18:34
· 257 commits to master since this release

In 1.2.0, you can now handle the animation of flash message removals. First, you'll need to add an extendedTimeout option when you add a single flash, or add it to your config as follows:

module.exports = function(environment) {
  var ENV = {
    flashMessageDefaults: {
      timeout            : 4000,
      extendedTimeout    : 1000,
      priority           : 200,
      sticky             : true,
      showProgress       : true,
      type               : 'alpaca',
      types              : [ 'alpaca', 'notice', 'foobar' ],
      injectionFactories : [ 'route', 'controller', 'view', 'component' ]
    }
  }

The extended timeout will extend the life of your flash message, and will add the exiting class to the flash message component prior to removal. So in the above example, the flash message's lifespan is 5 seconds, and in the last second will have a class exiting added to it. Thanks to @jrjohnson for this feature.

Changelog