aboutsummaryrefslogtreecommitdiffstats
path: root/libmproxy/web/static/js
diff options
context:
space:
mode:
authorMaximilian Hils <git@maximilianhils.com>2014-12-23 01:26:03 +0100
committerMaximilian Hils <git@maximilianhils.com>2014-12-23 01:26:03 +0100
commit459772a8ef79ac0adeaeba56577972e86074265e (patch)
tree89d6af5cbe8553d12a5263fc82ab5b44d12a2a4a /libmproxy/web/static/js
parentb55d584309ed6fde064c3f251e4d21e2ab754acd (diff)
downloadmitmproxy-459772a8ef79ac0adeaeba56577972e86074265e.tar.gz
mitmproxy-459772a8ef79ac0adeaeba56577972e86074265e.tar.bz2
mitmproxy-459772a8ef79ac0adeaeba56577972e86074265e.zip
web: squash bugs
Diffstat (limited to 'libmproxy/web/static/js')
-rw-r--r--libmproxy/web/static/js/app.js28
1 files changed, 12 insertions, 16 deletions
diff --git a/libmproxy/web/static/js/app.js b/libmproxy/web/static/js/app.js
index 50474353..4347ada5 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 () {
},