How to use the rax.findDOMNode function in rax

To help you get started, we’ve selected a few rax 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 alibaba / rax / components / rax-tabheader / src / DropDown.js View on Github external
closePop = () => {
    const icon = findDOMNode(this.refs.icon);
    Animated.rotate(icon, 360);
    const dropMultiRow = findDOMNode(this.refs.dropMultiRow);
    Animated.height(dropMultiRow, 0);

    if (!this.closePopIndex) {
      this.closePopIndex = 1;
    }
    this.closePopIndex++;

    this.state.weexGridTop = -1000 - this.closePopIndex; // fix for android
    this.state.weexGridLeft = -1000 - this.closePopIndex;
    this.state.weexGridPosition = 'relative';
    this.state.weexGridHeight = 0;
    this.setState(this.state);
  }
github alibaba / rax / packages / rax-slider / src / slider.web.js View on Github external
} else {
      this.index = index;
    }
    this.offsetX = this.index * this.width;

    const realIndex = this.loopedIndex();

    // translate3d for performance optimization
    let swipeView = findDOMNode(this.refs.swipeView);
    const styleText = `translate3d(${-1 * this.offsetX}px, 0px, 0px)`;
    swipeView.style.transform = styleText;
    swipeView.style.webkitTransform = styleText;

    this.loopIdx = this.index < 0 && realIndex !== 0 ? this.total - realIndex : realIndex;
    let childNum = 'child' + this.loopIdx;
    let childView = findDOMNode(this.refs[childNum]);
    childView.style.left = this.offsetX + 'px';

    this.props.onChange({index: this.loopIdx});
    this.setState({
      offsetX: this.offsetX
    });
  }
github alibaba / bindingx / web / weex-bindingx / demo / rax / delete.js View on Github external
function getEl(el) {
  return isWeex ? findDOMNode(el).ref : findDOMNode(el);
}
github alibaba / rax / components / rax-gotop / src / index.js View on Github external
click = (event) => {
    const {onTop, onPress} = this.props;

    onPress && onPress();
    if (isWeex) {
      let dom = __weex_require__('@weex-module/dom');
      let top = findDOMNode('rx-top');

      dom.scrollToElement(top.ref, {
        offset: 0
      });
    } else {
      event.preventDefault();
      scroll.scrollToTop({
        duration: 300
      });
    }
    onTop && onTop();
  }
github alibaba / rax / components / rax-tab-panel / src / DefaultView.js View on Github external
function getEl(el) {
  return isWeex ? findDOMNode(el).ref : findDOMNode(el);
}
github alibaba / rax / components / rax-scrollview / src / index.js View on Github external
scrollTo = (options) => {
    let x = parseInt(options.x);
    let y = parseInt(options.y);
    let animated = options && typeof options.animated !== 'undefined' ? options.animated : true;

    if (isWeex) {
      let dom = __weex_require__('@weex-module/dom');
      let contentContainer = findDOMNode(this.refs.contentContainer);
      dom.scrollToElement(contentContainer.ref, {
        offset: x || y || 0,
        animated
      });
    } else {
      let pixelRatio = document.documentElement.clientWidth / FULL_WIDTH;
      let scrollView = findDOMNode(this.refs.scroller);
      let scrollLeft = scrollView.scrollLeft;
      let scrollTop = scrollView.scrollTop;

      if (animated) {
        let timer = new Timer({
          duration: 400,
          easing: 'easeOutSine',
          onRun: (e) => {
            if (x >= 0) {
github alibaba / bindingx / web / weex-bindingx / demo / rax / timing.js View on Github external
function getEl(el) {
  return isWeex ? findDOMNode(el).ref : findDOMNode(el);
}
github alibaba / rax / packages / rax-tabheader / src / AnimBuoy.js View on Github external
scrollTo = (options) => {
    if (this.props.animType != 'noanim') {
      const animbuoy = findDOMNode(this.refs.animbuoy);
      Animated.scrollTo(animbuoy, options);
    }
  }
github alibaba / rax / components / rax-parallax / src / index.js View on Github external
render() {
    let {bindingScroller} = this.props;
    if (!bindingScroller) return null;

    let scroller = isWeex ? findDOMNode(bindingScroller).ref : findDOMNode(bindingScroller);
    if (isSupportBinding || !isWeex) {
      return ;
    }

    return isWeex ?  :
github alibaba / rax / packages / rax-tabbar / src / TabBar.js View on Github external
if (isWeex) {
      try {
        let dom = __weex_require__('@weex-module/dom');
        let k = parseInt(750 / tabItemWidth / 2);
        let selected = this.refs[`tab_${this.state.selectedIndex - k}`];
        if (selected) {
          dom.scrollToElement(findDOMNode(selected), {
            offset: 0
          });
        }
      } catch (e) {
        //
      }
    } else {
      if (findDOMNode(this.refs.ScrollBar)) {
        this.refs.ScrollBar.scrollTo({x: scrollLen});
      }
    }
  }