summaryrefslogtreecommitdiffstats
path: root/module/web/static/js/models/TreeCollection.js
diff options
context:
space:
mode:
authorGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2012-12-23 20:10:01 +0100
committerGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2012-12-23 20:10:01 +0100
commitb18fa59e40ebe9c03f81d49cf53a85bc728de8a7 (patch)
treecf28b8bb661cbb95592be89177cf82a325a0f6ea /module/web/static/js/models/TreeCollection.js
parentcleaned the settings page (diff)
downloadpyload-b18fa59e40ebe9c03f81d49cf53a85bc728de8a7.tar.xz
proper selecting, expanding and rendering of packageViews
Diffstat (limited to 'module/web/static/js/models/TreeCollection.js')
-rw-r--r--module/web/static/js/models/TreeCollection.js20
1 files changed, 10 insertions, 10 deletions
diff --git a/module/web/static/js/models/TreeCollection.js b/module/web/static/js/models/TreeCollection.js
index 27d2cefce..5949415c2 100644
--- a/module/web/static/js/models/TreeCollection.js
+++ b/module/web/static/js/models/TreeCollection.js
@@ -27,20 +27,20 @@ define(['jquery', 'backbone', 'underscore', 'models/Package', 'collections/FileL
},
// Parse the response and updates the collections
- parse: function(resp, xhr) {
- if (this.get('packages') === null)
- this.set('packages', new PackageList(_.values(resp.packages)));
+ parse: function(resp) {
+ var ret = {};
+ if (!this.has('packages'))
+ ret.packages = new PackageList(_.values(resp.packages));
else
- this.packages.update(_.values(resp.packages));
+ this.get('files').update(_.values(resp.packages));
- if (this.get('files') === null)
- this.set('files', new FileList(_.values(resp.files)));
+ if (!this.has('files'))
+ ret.files = new FileList(_.values(resp.files));
else
- this.files.update(_.values(resp.files));
+ this.get('files').update(_.values(resp.files));
- return {
- root: new Package(resp.root)
- };
+ ret.root = new Package(resp.root);
+ return ret;
}
});