How to use the ember-bootstrap/utils/transition-end function in ember-bootstrap

To help you get started, we’ve selected a few ember-bootstrap 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 kaliber5 / ember-bootstrap / addon / components / base / bs-contextual-help.js View on Github external
let tooltipShowComplete = () => {
      if (this.get('isDestroyed')) {
        return;
      }
      let prevHoverState = this.get('hoverState');

      this.get('onShown')(this);
      this.set('hoverState', null);

      if (prevHoverState === 'out') {
        this.leave();
      }
    };

    if (skipTransition === false && this.get('usesTransition')) {
      transitionEnd(this.get('overlayElement'), this.get('transitionDuration'))
        .then(tooltipShowComplete);
    } else {
      tooltipShowComplete();
    }
  }
github kaliber5 / ember-bootstrap / addon / components / base / bs-collapse.js View on Github external
hide() {
    this.get('onHide')();

    this.setProperties({
      transitioning: true,
      active: false
    });
    this.setCollapseSize(this.getExpandedSize('hide'));

    transitionEnd(this.get('element'), this.get('transitionDuration')).then(() => {
      if (this.get('isDestroyed')) {
        return;
      }
      this.set('transitioning', false);
      if (this.get('resetSizeWhenNotCollapsing')) {
        this.setCollapseSize(null);
      }
      this.get('onHidden')();
    });

    next(this, function() {
      if (!this.get('isDestroyed')) {
        this.setCollapseSize(this.get('collapsedSize'));
      }
    });
  }
github kaliber5 / ember-bootstrap / addon / components / base / bs-modal.js View on Github external
schedule('afterRender', this, function() {
        let backdrop = this.get('backdropElement');
        assert('Backdrop element should be in DOM', backdrop);
        if (doAnimate) {
          transitionEnd(backdrop, this.get('backdropTransitionDuration'))
            .then(callback);
        } else {
          callback();
        }
      });
github kaliber5 / ember-bootstrap / addon / components / base / bs-modal.js View on Github external
} else if (!this.get('isOpen') && this.get('backdrop')) {
      let backdrop = this.get('backdropElement');
      assert('Backdrop element should be in DOM', backdrop);

      let callbackRemove = () => {
        if (this.get('isDestroyed')) {
          return;
        }
        this.set('showBackdrop', false);
        if (callback) {
          callback.call(this);
        }
      };
      if (doAnimate) {
        transitionEnd(backdrop, this.get('backdropTransitionDuration'))
          .then(callbackRemove);
      } else {
        callbackRemove();
      }
    } else if (callback) {
      next(this, callback);
    }
  }
github kaliber5 / ember-bootstrap / addon / components / base / bs-modal.js View on Github external
hide() {
    if (!this._isOpen) {
      return;
    }
    this._isOpen = false;

    this.resize();
    this.set('showModal', false);

    if (this.get('usesTransition')) {
      transitionEnd(this.get('modalElement'), this.get('transitionDuration'))
        .then(() => this.hideModal());
    } else {
      this.hideModal();
    }
  }
github kaliber5 / ember-bootstrap / addon / components / base / bs-tab / pane.js View on Github external
hide() {
    if (this.get('usesTransition')) {
      transitionEnd(this.get('element'), this.get('fadeDuration'))
        .then(() => {
          if (!this.get('isDestroyed')) {
            this.set('active', false);
          }
        });
      this.set('showContent', false);
    } else {
      this.set('active', false);
    }
  }
github kaliber5 / ember-bootstrap / addon / components / base / bs-tab / pane.js View on Github external
show() {
    if (this.get('usesTransition')) {
      transitionEnd(this.get('element'), this.get('fadeDuration'))
        .then(() => {
          if (!this.get('isDestroyed')) {
            this.setProperties({
              active: true,
              showContent: true
            });
          }
        });
    } else {
      this.set('active', true);
    }
  }
github kaliber5 / ember-bootstrap / addon / components / base / bs-collapse.js View on Github external
show() {
    this.get('onShow')();

    this.setProperties({
      transitioning: true,
      active: true
    });
    this.setCollapseSize(this.get('collapsedSize'));

    transitionEnd(this.get('element'), this.get('transitionDuration')).then(() => {
      if (this.get('isDestroyed')) {
        return;
      }
      this.set('transitioning', false);
      if (this.get('resetSizeWhenNotCollapsing')) {
        this.setCollapseSize(null);
      }
      this.get('onShown')();
    });

    next(this, function() {
      if (!this.get('isDestroyed')) {
        this.setCollapseSize(this.getExpandedSize('show'));
      }
    });
  }