How to use the fbjs/lib/CSSCore.addClass function in fbjs

To help you get started, we’ve selected a few fbjs 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 subschema / subschema / subschema-component-form / src / ReactCSSTransitionGroupChild.js View on Github external
}

            clearTimeout(timeout);

            CSSCore.removeClass(node, className);
            CSSCore.removeClass(node, activeClassName);


            // Usually this optional callback is used for informing an owner of
            // a leave animation and telling it to remove the child.
            if (finishCallback) {
                finishCallback();
            }
        };

        CSSCore.addClass(node, className);

        // Need to do this to actually trigger a transition.
        this.queueClassAndNode(activeClassName, node);

        // If the user specified a timeout delay.
        if (userSpecifiedDelay) {
            // Clean-up the animation after the specified delay
            timeout = setTimeout(endListener, userSpecifiedDelay);
            this.transitionTimeouts.push(timeout);
        }
    }
github subschema / subschema / src / transition / EventCSSTransitionGroup.jsx View on Github external
return;
            }

            clearTimeout(timeout);

            removeClass(node, className);
            removeClass(node, activeClassName);

            // Usually this optional callback is used for informing an owner of
            // a leave animation and telling it to remove the child.
            if (finishCallback) {
                finishCallback();
            }
        };

        addClass(node, className);

        // Need to do this to actually trigger a transition.
        this.queueClass(activeClassName);
        // Clean-up the animation after the specified delay
        const timeout = setTimeout(endListener, userSpecifiedDelay);
        this.transitionTimeouts.push(timeout);
    };
github joshuaslate / saas-tutorial / node_modules / react / lib / ReactCSSTransitionGroupChild.js View on Github external
clearTimeout(timeout);

      CSSCore.removeClass(node, className);
      CSSCore.removeClass(node, activeClassName);

      ReactTransitionEvents.removeEndEventListener(node, endListener);

      // Usually this optional callback is used for informing an owner of
      // a leave animation and telling it to remove the child.
      if (finishCallback) {
        finishCallback();
      }
    };

    CSSCore.addClass(node, className);

    // Need to do this to actually trigger a transition.
    this.queueClass(activeClassName);

    // If the user specified a timeout delay.
    if (userSpecifiedDelay) {
      // Clean-up the animation after the specified delay
      timeout = setTimeout(endListener, userSpecifiedDelay);
      this.transitionTimeouts.push(timeout);
    } else {
      // DEPRECATED: this listener will be removed in a future version of react
      ReactTransitionEvents.addEndEventListener(node, endListener);
    }
  },
github zillow / react-slider / node_modules / react / lib / ReactCSSTransitionGroupChild.js View on Github external
clearTimeout(timeout);

        CSSCore.removeClass(node, className);
        CSSCore.removeClass(node, activeClassName);

        ReactTransitionEvents.removeEndEventListener(node, endListener);

        // Usually this optional callback is used for informing an owner of
        // a leave animation and telling it to remove the child.
        if (finishCallback) {
          finishCallback();
        }
      };

      CSSCore.addClass(node, className);

      // Need to do this to actually trigger a transition.
      _this.queueClassAndNode(activeClassName, node);

      // If the user specified a timeout delay.
      if (userSpecifiedDelay) {
        // Clean-up the animation after the specified delay
        timeout = setTimeout(endListener, userSpecifiedDelay);
        _this.transitionTimeouts.push(timeout);
      } else {
        // DEPRECATED: this listener will be removed in a future version of react
        ReactTransitionEvents.addEndEventListener(node, endListener);
      }
    }, _this.queueClassAndNode = function (className, node) {
      _this.classNameAndNodeQueue.push({
github diegoddox / react-redux-toastr / src / ToastrConfirm.js View on Github external
_setTransition = (add) => {
    const body = document.querySelector('body');

    if (add) {
      this.isHiding = false;
      CSSCore.addClass(body, 'toastr-confirm-active');
      CSSCore.addClass(this.confirm, 'bounceInDown');
      return;
    }

    this.isHiding = true;
    CSSCore.addClass(this.confirm, 'bounceOutUp');
  };
github facebook / react / src / addons / transitions / ReactCSSTransitionGroupChild.js View on Github external
this.classNameAndNodeQueue.forEach(function(obj) {
        CSSCore.addClass(obj.node, obj.className);
      });
    }
github diegoddox / react-redux-toastr / src / ToastrBox.js View on Github external
_setTransition = (hide) => {
    const node = this.toastrBox;
    const animationType = hide ? this.transitionOut : this.transitionIn;

    const onEndListener = (e) => {
      if (e && e.target == node) {
        CSSCore.removeClass(node, animationType);
      }
    };

    onCSSTransitionEnd(this.toastrBox, onEndListener);
    CSSCore.addClass(node, animationType);
  };
github diegoddox / react-redux-toastr / src / ToastrConfirm.js View on Github external
_setTransition = (add) => {
    const body = document.querySelector('body');

    if (add) {
      this.isHiding = false;
      CSSCore.addClass(body, 'toastr-confirm-active');
      CSSCore.addClass(this.confirm, 'bounceInDown');
      return;
    }

    this.isHiding = true;
    CSSCore.addClass(this.confirm, 'bounceOutUp');
  };
github diegoddox / react-redux-toastr / src / Button.js View on Github external
handleClick(e) {
    e.preventDefault();
    CSSCore.addClass(this.toastrButton, 'active');

    /*
     * In order to avoid event bubbling we need to call the onClick callback
     * after we have remove the css class 'active' that contains the animation
     */
    const end = () => {
      CSSCore.removeClass(this.toastrButton, 'active');
      if (this.props.onClick) {
        this.props.onClick && this.props.onClick();
      }
    };

    onCSSTransitionEnd(this.toastrButton, end);
  }