summaryrefslogtreecommitdiffstats
path: root/module/web/app/scripts/models/TreeCollection.js
diff options
context:
space:
mode:
Diffstat (limited to 'module/web/app/scripts/models/TreeCollection.js')
-rw-r--r--module/web/app/scripts/models/TreeCollection.js50
1 files changed, 0 insertions, 50 deletions
diff --git a/module/web/app/scripts/models/TreeCollection.js b/module/web/app/scripts/models/TreeCollection.js
deleted file mode 100644
index 2f761e6cc..000000000
--- a/module/web/app/scripts/models/TreeCollection.js
+++ /dev/null
@@ -1,50 +0,0 @@
-define(['jquery', 'backbone', 'underscore', 'app', 'models/Package', 'collections/FileList', 'collections/PackageList'],
- function($, Backbone, _, App, Package, FileList, PackageList) {
- 'use strict';
-
- // TreeCollection
- // A Model and not a collection, aggregates other collections
- return Backbone.Model.extend({
-
- defaults: {
- root: null,
- packages: null,
- files: null
- },
-
- initialize: function() {
-
- },
-
- fetch: function(options) {
- options || (options = {});
- var pid = options.pid || -1;
-
- options = App.apiRequest(
- 'getFileTree/' + pid,
- {full: false},
- options);
-
- console.log('Fetching package tree ' + pid);
- return Backbone.Model.prototype.fetch.call(this, options);
- },
-
- // Parse the response and updates the collections
- parse: function(resp) {
- var ret = {};
- if (!this.has('packages'))
- ret.packages = new PackageList(_.values(resp.packages));
- else
- this.get('packages').set(_.values(resp.packages));
-
- if (!this.has('files'))
- ret.files = new FileList(_.values(resp.files));
- else
- this.get('files').set(_.values(resp.files));
-
- ret.root = new Package(resp.root);
- return ret;
- }
-
- });
- }); \ No newline at end of file