aboutsummaryrefslogtreecommitdiffstats
path: root/web/src/js/store
diff options
context:
space:
mode:
authorMaximilian Hils <git@maximilianhils.com>2014-12-12 19:33:06 +0100
committerMaximilian Hils <git@maximilianhils.com>2014-12-12 19:33:06 +0100
commit588d6dbe22630333a4da6b4cb92158c25c4b858e (patch)
treed4cb2fec260fab89711ad43838cba8be170f03bf /web/src/js/store
parent5ccae48b92b093d68c8df8e557624cfb29d9c2fa (diff)
downloadmitmproxy-588d6dbe22630333a4da6b4cb92158c25c4b858e.tar.gz
mitmproxy-588d6dbe22630333a4da6b4cb92158c25c4b858e.tar.bz2
mitmproxy-588d6dbe22630333a4da6b4cb92158c25c4b858e.zip
web: filtering
Diffstat (limited to 'web/src/js/store')
-rw-r--r--web/src/js/store/store.js6
-rw-r--r--web/src/js/store/view.js6
2 files changed, 6 insertions, 6 deletions
diff --git a/web/src/js/store/store.js b/web/src/js/store/store.js
index 0f94e496..30932f18 100644
--- a/web/src/js/store/store.js
+++ b/web/src/js/store/store.js
@@ -29,7 +29,7 @@ _.extend(ListStore.prototype, EventEmitter.prototype, {
reset: function (elems) {
this.list = elems || [];
this._build_map();
- this.emit("recalculate", this.list);
+ this.emit("recalculate");
},
_build_map: function () {
this._pos_map = {};
@@ -54,11 +54,11 @@ function DictStore() {
_.extend(DictStore.prototype, EventEmitter.prototype, {
update: function (dict) {
_.merge(this.dict, dict);
- this.emit("recalculate", this.dict);
+ this.emit("recalculate");
},
reset: function (dict) {
this.dict = dict || {};
- this.emit("recalculate", this.dict);
+ this.emit("recalculate");
}
});
diff --git a/web/src/js/store/view.js b/web/src/js/store/view.js
index 56bc4dbd..4dba09e9 100644
--- a/web/src/js/store/view.js
+++ b/web/src/js/store/view.js
@@ -23,7 +23,7 @@ function StoreView(store, filt, sortfun) {
this.store.addListener("remove", this.remove);
this.store.addListener("recalculate", this.recalculate);
- this.recalculate(this.store.list, filt, sortfun);
+ this.recalculate(filt, sortfun);
}
_.extend(StoreView.prototype, EventEmitter.prototype, {
@@ -33,7 +33,7 @@ _.extend(StoreView.prototype, EventEmitter.prototype, {
this.store.removeListener("remove", this.remove);
this.store.removeListener("recalculate", this.recalculate);
},
- recalculate: function (elems, filt, sortfun) {
+ recalculate: function (filt, sortfun) {
if (filt) {
this.filt = filt;
}
@@ -41,7 +41,7 @@ _.extend(StoreView.prototype, EventEmitter.prototype, {
this.sortfun = sortfun.bind(this);
}
- this.list = elems.filter(this.filt);
+ this.list = this.store.list.filter(this.filt);
this.list.sort(function (a, b) {
return this.sortfun(a) - this.sortfun(b);
}.bind(this));