summaryrefslogtreecommitdiffstats
path: root/pyload/web/app/scripts/views/dashboard/dashboardView.js
diff options
context:
space:
mode:
authorGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2013-07-20 13:53:19 +0200
committerGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2013-07-20 13:53:19 +0200
commit75b44c9f5f19ec9403c08550d44013c3c23a3d2e (patch)
tree4e9704ae74194e453840b76cb2d5d414b7741ff7 /pyload/web/app/scripts/views/dashboard/dashboardView.js
parenttry to fix bug when refreshing page (diff)
downloadpyload-75b44c9f5f19ec9403c08550d44013c3c23a3d2e.tar.xz
small fixes
Diffstat (limited to 'pyload/web/app/scripts/views/dashboard/dashboardView.js')
-rw-r--r--pyload/web/app/scripts/views/dashboard/dashboardView.js14
1 files changed, 9 insertions, 5 deletions
diff --git a/pyload/web/app/scripts/views/dashboard/dashboardView.js b/pyload/web/app/scripts/views/dashboard/dashboardView.js
index a7779230b..8a0446203 100644
--- a/pyload/web/app/scripts/views/dashboard/dashboardView.js
+++ b/pyload/web/app/scripts/views/dashboard/dashboardView.js
@@ -1,6 +1,6 @@
-define(['jquery', 'backbone', 'underscore', 'app', 'models/TreeCollection',
+define(['jquery', 'backbone', 'underscore', 'app', 'models/TreeCollection', 'collections/FileList',
'./packageView', './fileView', 'hbs!tpl/dashboard/layout', 'select2'],
- function($, Backbone, _, App, TreeCollection, PackageView, FileView, template) {
+ function($, Backbone, _, App, TreeCollection, FileList, PackageView, FileView, template) {
'use strict';
// Renders whole dashboard
return Backbone.Marionette.ItemView.extend({
@@ -159,10 +159,14 @@ define(['jquery', 'backbone', 'underscore', 'app', 'models/TreeCollection',
// this works with ids and object TODO: not anymore
var file = this.files.get(fid);
if (file)
- if (_.isObject(data)) // update directly
+ if (_.isObject(data)) { // update directly
file.set(data);
- else // fetch from server
- file.fetch();
+ App.vent.trigger('dashboard:updated');
+ } else { // fetch from server
+ file.fetch({success: function() {
+ App.vent.trigger('dashboard:updated');
+ }});
+ }
}
});
}); \ No newline at end of file