diff options
Diffstat (limited to 'web/src/js/components/flowtable.js')
-rw-r--r-- | web/src/js/components/flowtable.js | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/web/src/js/components/flowtable.js b/web/src/js/components/flowtable.js index 609034f6..988d1895 100644 --- a/web/src/js/components/flowtable.js +++ b/web/src/js/components/flowtable.js @@ -1,10 +1,11 @@ -var React = require("react"); -var common = require("./common.js"); -var utils = require("../utils.js"); -var _ = require("lodash"); +import React from "react"; +import ReactDOM from 'react-dom'; +import {StickyHeadMixin, AutoScrollMixin} from "./common.js"; +import {reverseString} from "../utils.js"; +import _ from "lodash"; -var VirtualScrollMixin = require("./virtualscroll.js"); -var flowtable_columns = require("./flowtable-columns.js"); +import { VirtualScrollMixin } from "./virtualscroll.js" +import flowtable_columns from "./flowtable-columns.js"; var FlowRow = React.createClass({ render: function () { @@ -73,7 +74,7 @@ var FlowTableHead = React.createClass({ sortKeyFun = hasSort && function(){ var k = Column.sortKeyFun.apply(this, arguments); if(_.isString(k)){ - return utils.reverseString(""+k); + return reverseString(""+k); } else { return -k; } @@ -107,7 +108,7 @@ var FlowTableHead = React.createClass({ var ROW_HEIGHT = 32; var FlowTable = React.createClass({ - mixins: [common.StickyHeadMixin, common.AutoScrollMixin, VirtualScrollMixin], + mixins: [StickyHeadMixin, AutoScrollMixin, VirtualScrollMixin], contextTypes: { view: React.PropTypes.object.isRequired }, @@ -142,8 +143,8 @@ var FlowTable = React.createClass({ }, scrollIntoView: function (flow) { this.scrollRowIntoView( - this.context.view.index(flow), - this.refs.body.getDOMNode().offsetTop + this.context.view.indexOf(flow), + ReactDOM.findDOMNode(this.refs.body).offsetTop ); }, renderRow: function (flow) { @@ -184,4 +185,4 @@ var FlowTable = React.createClass({ } }); -module.exports = FlowTable; +export default FlowTable; |