How to use the dom-helpers/class.addClass function in dom-helpers

To help you get started, we’ve selected a few dom-helpers 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 choujimmy / jmui / src / components / Picker / Picker.js View on Github external
const modalDom = ReactDOM.findDOMNode(modal)
    if (!modalDom) {
      this.handleHide()
      return
    }
    if (!hasClass(modalDom, 'modal-in')) {
      this.handleHide()
      return
    }
    removeClass(modalDom, 'modal-in')
    const transitionEvent = whichTransitionEvent()
    const eventHandler = modalDom.addEventListener(transitionEvent, () => {
      modalDom.removeEventListener(transitionEvent, eventHandler)
      this.handleHide()
    })
    addClass(modalDom, 'modal-out')
  }
github soenkekluth / device.js / src / device.js View on Github external
handleOrientation() {
    this.onOrientationChange(this.landscape);
    if (!this.targetNode){
      return;
    }
    if (this.landscape) {
      removeClass(this.targetNode, 'portrait');
      addClass(this.targetNode, 'landscape');
    } else {
      removeClass(this.targetNode, 'landscape');
      addClass(this.targetNode, 'portrait');
    }
  }
github choujimmy / jmui / src / components / Picker / Picker.js View on Github external
adjustModalStyle () {
    const modal = this.refs['modal']
    if (!modal) {
      return
    }
    const modalDom = ReactDOM.findDOMNode(modal)
    if (modalDom) {
      addClass(modalDom, 'modal-in')
    }
  }
github Chimeejs / chimee / packages / chimee / src / dispatcher / dom.ts View on Github external
classNames.forEach((name) => {
      addClass(node, name);
    });
    this.plugins[id] = node;
github morlay / react-pure-mdl / docs / components / Resizable.js View on Github external
onResizeStart = () => {
    $.addClass(findDOMNode(this.refs.mask), 'show');
  };
github Chimeejs / chimee / packages / chimee-plugin-mobile-state / lib / index.js View on Github external
['loading', 'error', 'play'].forEach(function (key) {
      if (key === state && show) {
        _class.addClass(_this.$dom, key);
      } else {
        _class.removeClass(_this.$dom, key);
      }
    });
  };
github soenkekluth / device.js / src / device.js View on Github external
handleOrientation() {
    this.onOrientationChange(this.landscape);
    if (!this.targetNode){
      return;
    }
    if (this.landscape) {
      removeClass(this.targetNode, 'portrait');
      addClass(this.targetNode, 'landscape');
    } else {
      removeClass(this.targetNode, 'landscape');
      addClass(this.targetNode, 'portrait');
    }
  }