Sha256: bd7a4d4091b208eea897acad1aee57f3cf2c48187caeb8c0ee7d8e7978c67832

Contents?: true

Size: 852 Bytes

Versions: 2

Compression:

Stored size: 852 Bytes

Contents

import {Component} from 'react';
import ReactDom from 'react-dom';

/** @api private */
class Scroller extends Component {
  render() {
    return (
      <div ref="wrapper" className="scroller"><div>{this.props.children}</div></div>
    );
  }

  componentDidMount() {
    if (typeof jQuery !== 'undefined') {
      var element = jQuery(ReactDOM.findDOMNode(this.refs.wrapper));

      element.scroller();
      window.sss = this.scroller = element.scroller('instance');
    }
  }

  componentDidUpdate() {
    this.scroller.refresh();
  }

  enable() {
    this.scroller.enable();
    this.scroller.afterAnimationHook();
  }

  disable() {
    this.scroller.disable();
  }

  resetPosition(options) {
    this.scroller.resetPosition(options);
  }

  resetPosition(options) {
    this.scroller.resetPosition(options);
  }
};

export default Scroller;

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
pageflow-react-0.1.1 js/src/components/scroller.js
pageflow-react-0.1.0 js/src/components/scroller.js