2.0.0 • Published 4 years ago

ember-transition-end v2.0.0

Weekly downloads
78
License
MIT
Repository
github
Last release
4 years ago

ember-transition-end

Build Status GitHub version NPM version Dependency Status codecov

Information

NPM

Cross-browser transtionend event listener for Ember apps.

Installation

npm install ember-transition-end

Usage

import onTransitionEnd from 'ember-transition-end/utils/on-transition-end';

const element = document.querySelector('#foo');

onTransitionEnd(element, () => {
    // Do something...
}, { transitionProperty: 'all', once: true });

Arguments

Ordered by position:

  1. element

type: HTMLElement

The target element to listen when the animation ends.

  1. callback

type: Function

The callback executed each time the animation ends.

  1. options

type: Object

List of options to configure listener:

PropertyTypeDefaultDescription
transitionPropertyStringallCSS Transition Property.
onceBooleanfalseTrigger listener only once.
onlyTargetBooleanfalseOnly listen for transitions on target element.

Return value

It returns a removeEventListener callback to be used to remove event listener.

import onTransitionEnd from 'ember-transition-end/utils/on-transition-end';

const element = document.querySelector('#foo');

const removeEventListener = onTransitionEnd(element, () => {
    // Do something...
});

// remove event listener
removeEventListener();

Contribute

If you want to contribute to this addon, please read the CONTRIBUTING.md.

Versioning

We use SemVer for versioning. For the versions available, see the tags on this repository.

Authors

See the list of contributors who participated in this project.

License

This project is licensed under the MIT License.