From 588d6dbe22630333a4da6b4cb92158c25c4b858e Mon Sep 17 00:00:00 2001 From: Maximilian Hils Date: Fri, 12 Dec 2014 19:33:06 +0100 Subject: web: filtering --- web/src/js/store/store.js | 6 +++--- web/src/js/store/view.js | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'web/src/js/store') 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)); -- cgit v1.2.3