aboutsummaryrefslogtreecommitdiffstats
path: root/web/src/js/store/view.js
diff options
context:
space:
mode:
Diffstat (limited to 'web/src/js/store/view.js')
-rw-r--r--web/src/js/store/view.js14
1 files changed, 11 insertions, 3 deletions
diff --git a/web/src/js/store/view.js b/web/src/js/store/view.js
index 9619f994..e96d1bcc 100644
--- a/web/src/js/store/view.js
+++ b/web/src/js/store/view.js
@@ -1,3 +1,7 @@
+var _ = require("lodash");
+
+var utils = require("../utils.js");
+
function SortByStoreOrder(elem) {
return this.store.index(elem.id);
}
@@ -8,7 +12,7 @@ var default_filt = function(elem){
};
function StoreView(store, filt, sortfun) {
- EventEmitter.call(this);
+ utils.EventEmitter.call(this);
filt = filt || default_filt;
sortfun = sortfun || default_sort;
@@ -26,7 +30,7 @@ function StoreView(store, filt, sortfun) {
this.recalculate(filt, sortfun);
}
-_.extend(StoreView.prototype, EventEmitter.prototype, {
+_.extend(StoreView.prototype, utils.EventEmitter.prototype, {
close: function () {
this.store.removeListener("add", this.add);
this.store.removeListener("update", this.update);
@@ -96,4 +100,8 @@ _.extend(StoreView.prototype, EventEmitter.prototype, {
}
}
}
-}); \ No newline at end of file
+});
+
+module.exports = {
+ StoreView: StoreView
+}; \ No newline at end of file