aboutsummaryrefslogtreecommitdiffstats
path: root/web/src/js
diff options
context:
space:
mode:
Diffstat (limited to 'web/src/js')
-rw-r--r--web/src/js/components/flowtable.jsx.js7
-rw-r--r--web/src/js/components/mainview.jsx.js19
-rw-r--r--web/src/js/store/view.js2
3 files changed, 12 insertions, 16 deletions
diff --git a/web/src/js/components/flowtable.jsx.js b/web/src/js/components/flowtable.jsx.js
index 50caaab3..efc975a6 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 <FlowRow key={flow.id}
ref={flow.id}
flow={flow}
diff --git a/web/src/js/components/mainview.jsx.js b/web/src/js/components/mainview.jsx.js
index be20a357..113b0896 100644
--- a/web/src/js/components/mainview.jsx.js
+++ b/web/src/js/components/mainview.jsx.js
@@ -15,27 +15,18 @@ var MainView = React.createClass({
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/store/view.js b/web/src/js/store/view.js
index 4dba09e9..2b80292a 100644
--- a/web/src/js/store/view.js
+++ b/web/src/js/store/view.js
@@ -35,7 +35,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);