summaryrefslogtreecommitdiffstats
path: root/pyload/web/app/scripts/views/linkgrabber/collectorView.js
diff options
context:
space:
mode:
Diffstat (limited to 'pyload/web/app/scripts/views/linkgrabber/collectorView.js')
-rw-r--r--pyload/web/app/scripts/views/linkgrabber/collectorView.js21
1 files changed, 21 insertions, 0 deletions
diff --git a/pyload/web/app/scripts/views/linkgrabber/collectorView.js b/pyload/web/app/scripts/views/linkgrabber/collectorView.js
new file mode 100644
index 000000000..d2b43f699
--- /dev/null
+++ b/pyload/web/app/scripts/views/linkgrabber/collectorView.js
@@ -0,0 +1,21 @@
+define(['jquery', 'underscore', 'backbone', 'app', './packageView'],
+ function($, _, Backbone, App, packageView) {
+ 'use strict';
+ return Backbone.Marionette.CollectionView.extend({
+ itemView: packageView,
+ updateData: function(result) {
+ var self = this;
+ _.each(result.data, function(links, name) {
+ var pack = self.collection.get(name);
+ if (!pack) {
+ pack = new self.collection.model({name: name});
+ self.collection.add(pack);
+ }
+
+ // TODO: remove links from all other packages than pack
+ pack.updateLinks(links);
+ });
+ }
+
+ });
+ }); \ No newline at end of file