How to use the ember-css-transitions/utils/transition-utils.nextTick function in ember-css-transitions

To help you get started, we’ve selected a few ember-css-transitions examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github peec / ember-css-transitions / addon / modifiers / css-transition.js View on Github external
async transition(animationType, transitionClass) {
    let element = this.el;

    let className = `${transitionClass}-${animationType}`;
    let activeClassName = `${className}-active`;

    // add first class right away
    this.addClass(className);

    await nextTick()

    // This is for to force a repaint,
    // which is necessary in order to transition styles when adding a class name.
    element.scrollTop;
    // add active class after repaint
    this.addClass(activeClassName);

    // if we're animating a class removal
    // we need to remove the class
    if (animationType === 'remove') {
      this.removeClass(transitionClass);
    }

    // wait for ember to apply classes
    // set timeout for animation end
    await sleep(computeTimeout(element) || 0);
github peec / ember-css-transitions / addon / modifiers / css-transition.js View on Github external
async didInstall() {
    this.applyClasses();

    let transitionClass = this.transitionClass;

    if (transitionClass) {
      let animationType = 'enter';
      let className = `${transitionClass}-${animationType}`;
      this.addClass(className);

      await nextTick();
      await this.transition('enter', transitionClass);

      if (this.args.named.didTransitionIn) {
        this.args.named.didTransitionIn();
      }
    }
  }

ember-css-transitions

Ember implementation of CSS Transitions. Just like ng-animate and react animation but for Ember.

MIT
Latest version published 12 months ago

Package Health Score

61 / 100
Full package analysis