From 18c6342ce19374de5199978b0e2f8c19135d7f46 Mon Sep 17 00:00:00 2001 From: RaNaN Date: Tue, 9 Jul 2013 21:45:02 +0200 Subject: render progress correctly again --- pyload/web/app/scripts/views/dashboard/dashboardView.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'pyload/web/app/scripts/views/dashboard/dashboardView.js') diff --git a/pyload/web/app/scripts/views/dashboard/dashboardView.js b/pyload/web/app/scripts/views/dashboard/dashboardView.js index e7adba475..f305ac2f4 100644 --- a/pyload/web/app/scripts/views/dashboard/dashboardView.js +++ b/pyload/web/app/scripts/views/dashboard/dashboardView.js @@ -65,7 +65,6 @@ define(['jquery', 'backbone', 'underscore', 'app', 'models/TreeCollection', update: function() { console.log('Update package list'); - // TODO: Both null var packs = this.tree.get('packages'); this.files = this.tree.get('files'); @@ -156,8 +155,13 @@ define(['jquery', 'backbone', 'underscore', 'app', 'models/TreeCollection', // Refresh the file if it is currently shown fileUpdated: function(data) { - // this works with ids and object - var file = this.files.get(data); + var fid; + if (_.isObject(data)) + fid = data.fid; + else + fid = data; + // this works with ids and object TODO: not anymore + var file = this.files.get(fid); if (file) if (_.isObject(data)) // update directly file.set(data); -- cgit v1.2.3