diff --git a/libmproxy/web/static/js/app.js b/libmproxy/web/static/js/app.js index 504743539..4347ada58 100644 --- a/libmproxy/web/static/js/app.js +++ b/libmproxy/web/static/js/app.js @@ -2293,7 +2293,7 @@ _.extend(StoreView.prototype, EventEmitter.prototype, { }, recalculate: function (filt, sortfun) { if (filt) { - this.filt = filt; + this.filt = filt.bind(this); } if (sortfun) { this.sortfun = sortfun.bind(this); @@ -3138,7 +3138,12 @@ var FlowTable = React.createClass({displayName: 'FlowTable', }, renderRow: function (flow) { var selected = (flow === this.props.selected); - var highlighted = (this.props.view._highlight && this.props.view._highlight[flow.id].length > 0); + var highlighted = + ( + this.props.view._highlight && + this.props.view._highlight[flow.id] + ); + return React.createElement(FlowRow, {key: flow.id, ref: flow.id, flow: flow, @@ -3538,27 +3543,18 @@ var MainView = React.createClass({displayName: 'MainView', try { var filt = Filt.parse(this.getQuery()[Query.FILTER] || ""); var highlightStr = this.getQuery()[Query.HIGHLIGHT]; - var highlight = highlightStr ? [Filt.parse(highlightStr)] : []; + var highlight = highlightStr ? Filt.parse(highlightStr) : false; } catch(e){ console.error("Error when processing filter: " + e); } - var FadedHighlightColors = ["hsla(57, 100%, 50%, 0.33)"]; - return function filter_and_highlight(flow) { - var view = this.state.view; - if(!view._highlight){ - view._highlight = {}; - } - view._highlight[flow.id] = []; - - for (var i = 0; i < highlight.length; i++) { - if (highlight[i] && highlight[i](flow)) { - view._highlight[flow.id].push(FadedHighlightColors[i]); - } + if(!this._highlight){ + this._highlight = {}; } + this._highlight[flow.id] = highlight && highlight(flow); return filt(flow); - }.bind(this); + }; }, getViewSort: function () { }, diff --git a/web/src/js/components/flowtable.jsx.js b/web/src/js/components/flowtable.jsx.js index 50caaab3f..efc975a6f 100644 --- a/web/src/js/components/flowtable.jsx.js +++ b/web/src/js/components/flowtable.jsx.js @@ -82,7 +82,12 @@ var FlowTable = React.createClass({ }, renderRow: function (flow) { var selected = (flow === this.props.selected); - var highlighted = (this.props.view._highlight && this.props.view._highlight[flow.id].length > 0); + var highlighted = + ( + this.props.view._highlight && + this.props.view._highlight[flow.id] + ); + return