summaryrefslogtreecommitdiffstats
path: root/pyload/web/app/scripts/views/dashboard/dashboardView.js
diff options
context:
space:
mode:
Diffstat (limited to 'pyload/web/app/scripts/views/dashboard/dashboardView.js')
-rw-r--r--pyload/web/app/scripts/views/dashboard/dashboardView.js8
1 files changed, 8 insertions, 0 deletions
diff --git a/pyload/web/app/scripts/views/dashboard/dashboardView.js b/pyload/web/app/scripts/views/dashboard/dashboardView.js
index 6a263bf03..fbf1055f5 100644
--- a/pyload/web/app/scripts/views/dashboard/dashboardView.js
+++ b/pyload/web/app/scripts/views/dashboard/dashboardView.js
@@ -30,6 +30,7 @@ define(['jquery', 'backbone', 'underscore', 'app', 'models/TreeCollection', 'col
// When package is added we reload the data
this.listenTo(App.vent, 'package:added', _.bind(this.fetch, this));
this.listenTo(App.vent, 'package:inserted', _.bind(this.fetch, this));
+ this.listenTo(App.vent, 'package:destroyed', _.bind(this.packageDestroyed, this));
this.listenTo(App.vent, 'file:updated', _.bind(this.fileUpdated, this));
@@ -170,6 +171,13 @@ define(['jquery', 'backbone', 'underscore', 'app', 'models/TreeCollection', 'col
App.vent.trigger('dashboard:updated');
}});
}
+ },
+
+ // destroys files when opened package is deleted
+ packageDestroyed: function(pack) {
+ // TODO: could be improved
+ if (pack.get('files') === this.files)
+ App.vent.trigger('dashboard:destroyContent')
}
});
}); \ No newline at end of file