diff options
author | Maximilian Hils <git@maximilianhils.com> | 2016-03-02 15:11:51 +0100 |
---|---|---|
committer | Maximilian Hils <git@maximilianhils.com> | 2016-03-02 15:11:51 +0100 |
commit | a1c76814e77751d79a7ea41db5036bc176089f86 (patch) | |
tree | f296ad49039285c2b55ee119d9f911e931acd7ff /web/src | |
parent | 8089752cb2b13fdb13500e577c459ce34abbcbea (diff) | |
parent | 70af4fae46a9b74feb2fd04f370ebce13d5450b0 (diff) | |
download | mitmproxy-a1c76814e77751d79a7ea41db5036bc176089f86.tar.gz mitmproxy-a1c76814e77751d79a7ea41db5036bc176089f86.tar.bz2 mitmproxy-a1c76814e77751d79a7ea41db5036bc176089f86.zip |
Merge pull request #991 from gzzhanghao/flowtable
[web] fix FlowTable.scrollIntoView
Diffstat (limited to 'web/src')
-rw-r--r-- | web/src/js/components/flowtable.js | 2 | ||||
-rw-r--r-- | web/src/js/store/view.js | 6 |
2 files changed, 4 insertions, 4 deletions
diff --git a/web/src/js/components/flowtable.js b/web/src/js/components/flowtable.js index 1d99c318..988d1895 100644 --- a/web/src/js/components/flowtable.js +++ b/web/src/js/components/flowtable.js @@ -143,7 +143,7 @@ var FlowTable = React.createClass({ }, scrollIntoView: function (flow) { this.scrollRowIntoView( - this.context.view.index(flow), + this.context.view.indexOf(flow), ReactDOM.findDOMNode(this.refs.body).offsetTop ); }, diff --git a/web/src/js/store/view.js b/web/src/js/store/view.js index 3ec337a1..d8aeba60 100644 --- a/web/src/js/store/view.js +++ b/web/src/js/store/view.js @@ -59,12 +59,12 @@ _.extend(StoreView.prototype, EventEmitter.prototype, { }); this.emit("recalculate"); }, - index: function (elem) { - return _.sortedIndexBy(this.list, elem, this.sortfun); + indexOf: function (elem) { + return this.list.indexOf(elem, _.sortedIndexBy(this.list, elem, this.sortfun)); }, add: function (elem) { if (this.filt(elem)) { - var idx = this.index(elem); + var idx = _.sortedIndexBy(this.list, elem, this.sortfun); if (idx === this.list.length) { //happens often, .push is way faster. this.list.push(elem); } else { |